1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00

Fix potential out-of-bounds read

This commit is contained in:
Yang Tse 2009-10-10 12:31:27 +00:00
parent 640e49976f
commit 4d9279cb3b

View File

@ -41,7 +41,7 @@ ares_bitncmp(const void *l, const void *r, int n) {
b = n / 8; b = n / 8;
x = memcmp(l, r, b); x = memcmp(l, r, b);
if (x) if (x || (n % 8) == 0)
return (x); return (x);
lb = ((const unsigned char *)l)[b]; lb = ((const unsigned char *)l)[b];