diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-09-17 15:58:34 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-09-17 15:58:34 +0100 |
commit | 31179739be8675f1414bfb66784170f2ba3d2b19 (patch) | |
tree | 15a8140e250000ec5965c7b637b294dc00f1f74b /src/libutil | |
parent | 543db308027e7fd173685409a304ab150ea9d269 (diff) | |
download | rspamd-31179739be8675f1414bfb66784170f2ba3d2b19.tar.gz rspamd-31179739be8675f1414bfb66784170f2ba3d2b19.zip |
Another case with repeating leaves.
Diffstat (limited to 'src/libutil')
-rw-r--r-- | src/libutil/radix.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libutil/radix.c b/src/libutil/radix.c index 7efbadf3c..1445dd0fe 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)) { |