From: Vsevolod Stakhov Date: Wed, 17 Sep 2014 14:58:34 +0000 (+0100) Subject: Another case with repeating leaves. X-Git-Tag: 0.7.1~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31179739be8675f1414bfb66784170f2ba3d2b19;p=thirdparty%2Frspamd.git Another case with repeating leaves. --- diff --git a/src/libutil/radix.c b/src/libutil/radix.c index 7efbadf3c5..1445dd0fe7 100644 --- a/src/libutil/radix.c +++ b/src/libutil/radix.c @@ -383,7 +383,7 @@ radix_compare_compressed (struct radix_compressed_node *node, /* Compare byte aligned levels of a compressed node */ shift = node->d.s.level / NBBY; - if (memcmp (node->d.s.key, key, shift) != 0) { + if (shift > 0 && memcmp (node->d.s.key, key, shift) != 0) { return FALSE; } @@ -391,7 +391,7 @@ radix_compare_compressed (struct radix_compressed_node *node, nk = node->d.s.key + shift; k = key + shift; rbits = node->d.s.level % NBBY; - bit = 1 << (7 - rbits); + bit = 1 << 7; while (rbits > 0) { if ((*nk & bit) != (*k & bit)) {