summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1997-11-21 22:42:55 +0000
committerderaadt <deraadt@openbsd.org>1997-11-21 22:42:55 +0000
commitafa03bb655996046ef00157acd2e1eadeae07a8c (patch)
tree1c14e526cea8b9b23085fca4acd95d02b4e4d36f
parentevil art forgot to crank the minor number (diff)
downloadwireguard-openbsd-afa03bb655996046ef00157acd2e1eadeae07a8c.tar.xz
wireguard-openbsd-afa03bb655996046ef00157acd2e1eadeae07a8c.zip
bail if no arp entries
-rw-r--r--usr.sbin/arp/arp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/arp/arp.c b/usr.sbin/arp/arp.c
index c60e91739ff..1955b600586 100644
--- a/usr.sbin/arp/arp.c
+++ b/usr.sbin/arp/arp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: arp.c,v 1.8 1997/09/12 04:07:16 millert Exp $ */
+/* $OpenBSD: arp.c,v 1.9 1997/11/21 22:42:55 deraadt Exp $ */
/* $NetBSD: arp.c,v 1.12 1995/04/24 13:25:18 cgd Exp $ */
/*
@@ -373,6 +373,8 @@ dump(addr)
mib[5] = RTF_LLINFO;
if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0)
err(1, "route-sysctl-estimate");
+ if (needed == 0)
+ return;
if ((buf = malloc(needed)) == NULL)
err(1, "malloc");
if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0)