News for hackers. Stuff that matters.
Re:Let's code a TCP/IP stack, 1: Ethernet and ARP by megous on Sunday March 06, 2016 @05:00PM (#11235758)
Strncpy is not used correctly either.

  strncpy(ifr.ifr_name, dev, IFNAMSIZ);
will not necessarily NULL terminate ifr.ifr_name for all values of dev variable. NULL terminated input is assumed later when ifr.ifr_name is used in strcpy.
Re:Let's code a TCP/IP stack, 1: Ethernet and ARP by user2994cb on Sunday March 06, 2016 @05:59PM (#11236015)
In this case, it seems the ioctl call will do the null termination & in fact, the kernel itself uses strcpy for that field (presumably OK since the device structure has a null terminated name):

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux....