]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
silence coverity - reviewed by Evan over jabber
authorMark Andrews <marka@isc.org>
Mon, 30 Jun 2014 23:52:02 +0000 (09:52 +1000)
committerMark Andrews <marka@isc.org>
Mon, 30 Jun 2014 23:52:02 +0000 (09:52 +1000)
lib/isc/netaddr.c

index acb44acebdc17be7ea3af29b54c9c0aef686a1f2..dcbfba42eae881e7e482c406b9727db205eb8599 100644 (file)
@@ -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);
 }