]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
Fix potential out-of-bounds read
authorYang Tse <yangsita@gmail.com>
Sat, 10 Oct 2009 12:31:27 +0000 (12:31 +0000)
committerYang Tse <yangsita@gmail.com>
Sat, 10 Oct 2009 12:31:27 +0000 (12:31 +0000)
ares/bitncmp.c

index b9077bacccae8e5998236352ceccd1d9b6ee3b71..30891861f54390b63a9b504b2d83d724827b2bbb 100644 (file)
@@ -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];