]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
lib/cache: shut up linters
authorVladimír Čunát <vladimir.cunat@nic.cz>
Fri, 24 Apr 2020 10:24:42 +0000 (12:24 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 27 Apr 2020 12:57:08 +0000 (14:57 +0200)
It makes no sense to run produce/consume with either of these NULL.

lib/cache/peek.c

index 0d66bb6303253cc7efa25e135014a489f84809bf..dc7cd7fe3907466444e187da9aec8621cd210c40 100644 (file)
@@ -79,6 +79,8 @@ static int nsec_p_ttl(knot_db_val_t entry, const uint32_t timestamp, int32_t *ne
 
 static uint8_t get_lowest_rank(const struct kr_query *qry, const knot_dname_t *name, const uint16_t type)
 {
+       /* Shut up linters. */
+       if (unlikely(!qry || !qry->request)) abort();
        /* TODO: move rank handling into the iterator (DNSSEC_* flags)? */
        const bool allow_unverified =
                knot_wire_get_cd(qry->request->qsource.packet->wire) || qry->flags.STUB;