From e31a37787bbde482e2e26f89d8ad4c2ada5cc3b8 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Tue, 1 Jul 2014 09:52:02 +1000 Subject: [PATCH] silence coverity - reviewed by Evan over jabber --- lib/isc/netaddr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/isc/netaddr.c b/lib/isc/netaddr.c index acb44acebd..dcbfba42ea 100644 --- a/lib/isc/netaddr.c +++ b/lib/isc/netaddr.c @@ -240,7 +240,7 @@ isc_netaddr_prefixok(const isc_netaddr_t *na, unsigned int prefixlen) { return (ISC_R_FAILURE); nbytes++; } - if (memcmp(p + nbytes, zeros, ipbytes - nbytes) != 0) + if (nbytes < ipbytes && memcmp(p + nbytes, zeros, ipbytes - nbytes) != 0) return (ISC_R_FAILURE); return (ISC_R_SUCCESS); }