summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ndp
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2016-01-12 09:47:13 +0000
committermpi <mpi@openbsd.org>2016-01-12 09:47:13 +0000
commitd999f9dfcf8cfefe854590aa4007b8d5f1fb8805 (patch)
tree4d83c3fcdad6bc06afdd54d8a3b670c8f008c0a4 /usr.sbin/ndp
parentPrevent a possible NULL-derefenced introduced by the move of RA sleeping (diff)
downloadwireguard-openbsd-d999f9dfcf8cfefe854590aa4007b8d5f1fb8805.tar.xz
wireguard-openbsd-d999f9dfcf8cfefe854590aa4007b8d5f1fb8805.zip
Do not print an error if the list of prefixes is empty.
This is becoming more and more comon now that the list is only used for autoconfigured prefix. From Florian Riehm.
Diffstat (limited to 'usr.sbin/ndp')
-rw-r--r--usr.sbin/ndp/ndp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/ndp/ndp.c b/usr.sbin/ndp/ndp.c
index d14dd41c67a..230ba3eb4dd 100644
--- a/usr.sbin/ndp/ndp.c
+++ b/usr.sbin/ndp/ndp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ndp.c,v 1.67 2015/10/28 12:14:25 florian Exp $ */
+/* $OpenBSD: ndp.c,v 1.68 2016/01/12 09:47:13 mpi Exp $ */
/* $KAME: ndp.c,v 1.101 2002/07/17 08:46:33 itojun Exp $ */
/*
@@ -1055,6 +1055,8 @@ plist(void)
err(1, "sysctl(ICMPV6CTL_ND6_PRLIST)");
/*NOTREACHED*/
}
+ if (l == 0)
+ return;
buf = malloc(l);
if (buf == NULL) {
err(1, "malloc");