]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
modules/nsid: improve sanity check
authorTomas Krizek <tomas.krizek@nic.cz>
Tue, 26 Oct 2021 10:17:34 +0000 (12:17 +0200)
committerTomas Krizek <tomas.krizek@nic.cz>
Mon, 8 Nov 2021 15:07:50 +0000 (16:07 +0100)
modules/nsid/nsid.c

index 09f6d39ef7c6536edd7421b98e6c887fca1924f2..a67dcdb5a616a0b833e0c71d6f6aebea58e69274 100644 (file)
@@ -43,7 +43,7 @@ static int nsid_finalize(kr_layer_t *ctx) {
                /* FIXME: actually change RCODE in answer to FORMERR? */
 
        /* Sanity check, answer should have EDNS as well but who knows ... */
-       if (req->answer->opt_rr == NULL)
+       if (kr_fails_assert(req->answer->opt_rr))
                return ctx->state;
 
        if (knot_edns_add_option(req->answer->opt_rr, KNOT_EDNS_OPTION_NSID,