]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix null pointer dereferences in udp_ready()
authorOndřej Surý <ondrej@isc.org>
Sun, 6 Mar 2022 09:16:29 +0000 (10:16 +0100)
committerOndřej Surý <ondrej@isc.org>
Sun, 6 Mar 2022 09:18:20 +0000 (10:18 +0100)
The query pointer was detached too early leading to null pointer
reference.  Move the query_detach() after the query->canceled check.

bin/dig/dighost.c

index faad62c13c61021aba22c3b403e490c73b873b81..c736a3357a4391e252ab8c4a7b711f50a5f4d04e 100644 (file)
@@ -2900,10 +2900,10 @@ udp_ready(isc_nmhandle_t *handle, isc_result_t eresult, void *arg) {
                dig_lookup_t *l = query->lookup;
 
                debug("in cancel handler");
-               query_detach(&query);
                if (!query->canceled) {
                        cancel_lookup(l);
                }
+               query_detach(&query);
                lookup_detach(&l);
                return;
        } else if (eresult != ISC_R_SUCCESS) {