fix off by one in record find code
authorJohn Crispin <blogic@openwrt.org>
Wed, 25 Jun 2014 02:32:22 +0000 (03:32 +0100)
committerJohn Crispin <blogic@openwrt.org>
Wed, 25 Jun 2014 02:32:22 +0000 (03:32 +0100)
Signed-off-by: John Crispin <blogic@openwrt.org>
cache.c

diff --git a/cache.c b/cache.c
index 150fb260905843abec5995172928190d6fdf36e9..357caddd930bc056890edf68c9c895e06d909493 100644 (file)
--- a/cache.c
+++ b/cache.c
@@ -167,7 +167,7 @@ cache_record_find(char *record, int type, int port, int rdlength, uint8_t *rdata
        if (!l)
                return NULL;
 
-       while (l && !avl_is_last(&records, &l->avl) && !strcmp(l->record, record)) {
+       while (l && !strcmp(l->record, record)) {
                struct cache_record *r = l;
 
                l = avl_next_element(l, avl);