net-tools/net-tools-1.60-nameif_strncpy.patch

15 lines
546 B
Diff
Raw Normal View History

2011-12-06 18:15:09 +00:00
diff -up net-tools-1.60/nameif.c.strncpy net-tools-1.60/nameif.c
--- net-tools-1.60/nameif.c.strncpy 2011-12-06 12:35:36.123687853 +0100
+++ net-tools-1.60/nameif.c 2011-12-06 12:35:36.270686015 +0100
@@ -100,8 +100,8 @@ int setname(char *oldname, char *newnam
2006-10-03 12:29:53 +00:00
struct ifreq ifr;
opensock();
memset(&ifr,0,sizeof(struct ifreq));
- strcpy(ifr.ifr_name, oldname);
- strcpy(ifr.ifr_newname, newname);
2011-12-06 18:15:09 +00:00
+ strncpy(ifr.ifr_name, oldname, IFNAMSIZ);
+ strncpy(ifr.ifr_newname, newname, IFNAMSIZ);
2006-10-03 12:29:53 +00:00
return ioctl(ctl_sk, SIOCSIFNAME, &ifr);
}