summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Popelka <jpopelka@redhat.com>2011-12-07 18:43:03 +0100
committerJiri Popelka <jpopelka@redhat.com>2012-01-05 12:22:43 +0100
commit96b25f189e5b584a1d6ece3a1a81dacb6d53969b (patch)
treeb86eb99e52dd250220b5d81bddaa7dda3cef4ab1
parentf1f89328cccf92824ab436fa43068603eb43e34d (diff)
downloadnet-tools-96b25f189e5b584a1d6ece3a1a81dacb6d53969b.tar.gz
net-tools-96b25f189e5b584a1d6ece3a1a81dacb6d53969b.tar.bz2
net-tools-96b25f189e5b584a1d6ece3a1a81dacb6d53969b.zip
buffer overflow in arp (RHBZ #164695)
Steps to Reproduce: 1. arp -s 172.16.1.3 00:80:c8:04:05:06 -D eth0
-rw-r--r--arp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arp.c b/arp.c
index 8a376ec..72e87d6 100644
--- a/arp.c
+++ b/arp.c
@@ -243,7 +243,7 @@ static int arp_getdevhw(char *ifname, struct sockaddr *sa, struct hwtype *hw)
struct ifreq ifr;
struct hwtype *xhw;
- strcpy(ifr.ifr_name, ifname);
+ strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
if (ioctl(sockfd, SIOCGIFHWADDR, &ifr) < 0) {
fprintf(stderr, _("arp: cant get HW-Address for `%s': %s.\n"), ifname, strerror(errno));
return (-1);