]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
cache: nitpick after !532 (no effect)
authorVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 28 Mar 2018 10:36:40 +0000 (12:36 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 28 Mar 2018 10:36:40 +0000 (12:36 +0200)
lib/cache/nsec1.c

index c3e3e2208c90f192783ccc9f418a562e2ca24477..bdc64c3fa6fa2ebbdf905d60196f152454bfff3d 100644 (file)
@@ -216,11 +216,13 @@ static const char * find_leq_NSEC1(struct kr_cache *cache, const struct kr_query
        }
        /* We know it starts before sname, so let's check the other end.
         * 1. construct the key for the next name - kwz_hi. */
-       const knot_dname_t *next = eh->data + 2 * KR_CACHE_RR_COUNT_SIZE; /* it's *full* name ATM */
+       /* it's *full* name ATM */
+       const knot_dname_t *next = eh->data + KR_CACHE_RR_COUNT_SIZE
+                                + 2 /* RDLENGTH from rfc1034 */;
        if (!eh->data[0]) {
                assert(false);
                return "ERROR";
-               /* TODO: more checks?  Also, `data + 3` is kinda messy. */
+               /* TODO: more checks?  Also, `next` computation is kinda messy. */
        }
        /*
        WITH_VERBOSE {