]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Another case with repeating leaves.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 17 Sep 2014 14:58:34 +0000 (15:58 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 17 Sep 2014 14:58:34 +0000 (15:58 +0100)
src/libutil/radix.c

index 7efbadf3c5b8f0f4398a771ac8a230f59903bafb..1445dd0fe7a227b59031b752b36a075245912184 100644 (file)
@@ -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)) {