diff options
author | Yang Tse <yangsita@gmail.com> | 2009-10-10 12:31:27 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2009-10-10 12:31:27 +0000 |
commit | 4d9279cb3b88e243d304fa9687fcc1cb146a1dcc (patch) | |
tree | c8bbc214cd3a48197ceacc975f08fdbc945b1e3a /ares | |
parent | 640e49976f34d766124cb6988dc4849c4acab6d0 (diff) |
Fix potential out-of-bounds read
Diffstat (limited to 'ares')
-rw-r--r-- | ares/bitncmp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ares/bitncmp.c b/ares/bitncmp.c index b9077bacc..30891861f 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]; |