From: Yang Tse Date: Sat, 10 Oct 2009 12:31:27 +0000 (+0000) Subject: Fix potential out-of-bounds read X-Git-Tag: curl-7_19_7~84 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d9279cb3b88e243d304fa9687fcc1cb146a1dcc;p=thirdparty%2Fcurl.git Fix potential out-of-bounds read --- diff --git a/ares/bitncmp.c b/ares/bitncmp.c index b9077baccc..30891861f5 100644 --- a/ares/bitncmp.c +++ b/ares/bitncmp.c @@ -41,7 +41,7 @@ ares_bitncmp(const void *l, const void *r, int n) { b = n / 8; x = memcmp(l, r, b); - if (x) + if (x || (n % 8) == 0) return (x); lb = ((const unsigned char *)l)[b];