Re: [PATCH]ethtool.c:fix buffer overflow when devname is too long

2006-08-30 Thread Jeff Garzik
[EMAIL PROTECTED] wrote: As the length of field ifr_name of struct ifreq is IFNAMSIZ(16) in header file /usr/include/net/if.h. It will result in buffer overflow when devname is too long. Modified strcpy to strncpy for only copying IFNAMSIZ bytes into struct ifreq. Also, by adding a section into

[PATCH]ethtool.c:fix buffer overflow when devname is too long

2006-08-30 Thread wangzyu
As the length of field ifr_name of struct ifreq is IFNAMSIZ(16) in header file /usr/include/net/if.h. It will result in buffer overflow when devname is too long. Modified strcpy to strncpy for only copying IFNAMSIZ bytes into struct ifreq. Also, by adding a section into parse_cmdline to detect