diff options
author | Jiri Popelka <jpopelka@redhat.com> | 2011-12-07 19:02:07 +0100 |
---|---|---|
committer | Jiri Popelka <jpopelka@redhat.com> | 2012-01-05 12:22:43 +0100 |
commit | 1f2c75dcb9998b2f4875adaa9c0e798d83aaaa77 (patch) | |
tree | e4b81554a9001ea38f9b3554891b70c784168415 | |
parent | cf3378018ca7c296a3bfc0170feb8883493e0944 (diff) | |
download | net-tools-1f2c75dcb9998b2f4875adaa9c0e798d83aaaa77.tar.gz net-tools-1f2c75dcb9998b2f4875adaa9c0e798d83aaaa77.tar.bz2 net-tools-1f2c75dcb9998b2f4875adaa9c0e798d83aaaa77.zip |
nameif crash for long interface names (RHBZ #209120)
I'm not sure how to reproduce that, but the patch
is quite straightforward.
-rw-r--r-- | nameif.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -99,8 +99,8 @@ int setname(char *oldname, char *newname) struct ifreq ifr; opensock(); memset(&ifr,0,sizeof(struct ifreq)); - strcpy(ifr.ifr_name, oldname); - strcpy(ifr.ifr_newname, newname); + strncpy(ifr.ifr_name, oldname, IFNAMSIZ); + strncpy(ifr.ifr_newname, newname, IFNAMSIZ); return ioctl(ctl_sk, SIOCSIFNAME, &ifr); } |