Fix potential out-of-bounds read

pull/1/head
Yang Tse 15 years ago
parent ec11480d8b
commit e804725e75
  1. 2
      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];

Loading…
Cancel
Save