diff options
author | Ashwini Sharma <ak.ashwini1981@gmail.com> | 2014-08-12 07:09:01 -0500 |
---|---|---|
committer | Ashwini Sharma <ak.ashwini1981@gmail.com> | 2014-08-12 07:09:01 -0500 |
commit | 7eb3e4364c2bcebd2fdfef52c07f5101aa03e5bb (patch) | |
tree | 3a71927fe5198488d24af53b030d71797b67de35 /toys/pending/arp.c | |
parent | 6a77734d1b1ac1938abbc33014b60cfb49828824 (diff) | |
download | toybox-7eb3e4364c2bcebd2fdfef52c07f5101aa03e5bb.tar.gz |
Patches to commands for issues reported from static analysis tool.
portability.h.patch - it is for O_CLOEXEC, as compiler complained of it.
Makefile.patch - for cleaning generated/*.o files and libopts.dat file
[Fixup to uniq.c from Rob.]
Diffstat (limited to 'toys/pending/arp.c')
-rw-r--r-- | toys/pending/arp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/toys/pending/arp.c b/toys/pending/arp.c index 831facb9..1153ebc1 100644 --- a/toys/pending/arp.c +++ b/toys/pending/arp.c @@ -175,7 +175,7 @@ static int set_entry(void) flags = ATF_PERM | ATF_COM; if (toys.optargs[2]) check_flags(&flags, (toys.optargs+2)); req.arp_flags = flags; - strncpy(req.arp_dev, TT.device, sizeof(TT.device)); + strncpy(req.arp_dev, TT.device, sizeof(req.arp_dev)); xioctl(TT.sockfd, SIOCSARP, &req); if (toys.optflags & FLAG_v) xprintf("Entry set for %s\n", toys.optargs[0]); @@ -204,7 +204,7 @@ static int delete_entry(void) flags = ATF_PERM; if (toys.optargs[1]) check_flags(&flags, (toys.optargs+1)); req.arp_flags = flags; - strncpy(req.arp_dev, TT.device, sizeof(TT.device)); + strncpy(req.arp_dev, TT.device, sizeof(req.arp_dev)); xioctl(TT.sockfd, SIOCDARP, &req); if (toys.optflags & FLAG_v) xprintf("Delete entry for %s\n", toys.optargs[0]); @@ -301,6 +301,7 @@ void arp_main(void) if (CFG_TOYBOX_FREE) { free(host_ip); + free(buf); xclose(fd); } } |