From 7eb3e4364c2bcebd2fdfef52c07f5101aa03e5bb Mon Sep 17 00:00:00 2001 From: Ashwini Sharma Date: Tue, 12 Aug 2014 07:09:01 -0500 Subject: 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.] --- toys/pending/arp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'toys/pending/arp.c') 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); } } -- cgit v1.2.3