summaryrefslogtreecommitdiff
path: root/usr.sbin/arp
diff options
context:
space:
mode:
authorSebastien Marie <semarie@cvs.openbsd.org>2015-10-05 14:58:38 +0000
committerSebastien Marie <semarie@cvs.openbsd.org>2015-10-05 14:58:38 +0000
commitb0d0e4442a4f4a0ce60042933d28c2bea770207d (patch)
tree6b52f30fcee4e8c94d9f283bec1b400d317c982b /usr.sbin/arp
parent4b97f37f2d8ae219731f7e78911b5bebd2098f46 (diff)
correct a rtget() error check
this function could only return 0 or 1, and 1 on error. avoid to deref an uninitialised variable if rtget() return an error. ok millert@ benno@ deraadt@
Diffstat (limited to 'usr.sbin/arp')
-rw-r--r--usr.sbin/arp/arp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/arp/arp.c b/usr.sbin/arp/arp.c
index f4d89017dc9..a786685ac5f 100644
--- a/usr.sbin/arp/arp.c
+++ b/usr.sbin/arp/arp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: arp.c,v 1.65 2015/10/03 02:25:59 deraadt Exp $ */
+/* $OpenBSD: arp.c,v 1.66 2015/10/05 14:58:37 semarie Exp $ */
/* $NetBSD: arp.c,v 1.12 1995/04/24 13:25:18 cgd Exp $ */
/*
@@ -417,7 +417,7 @@ delete(const char *host, const char *info)
if (getinetaddr(host, &sin->sin_addr) == -1)
return (1);
tryagain:
- if (rtget(&sin, &sdl) < 0) {
+ if (rtget(&sin, &sdl)) {
warn("%s", host);
return (1);
}