]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
DoT: do not attempt to call read callback if it is not avaialble
authorArtem Boldariev <artem@boldariev.com>
Thu, 9 Sep 2021 13:52:55 +0000 (16:52 +0300)
committerArtem Boldariev <artem@boldariev.com>
Tue, 5 Oct 2021 08:26:14 +0000 (11:26 +0300)
This commit fixes a crash in DoT code when it was attempting to call a
read callback on the later stages of the connection when it is not
available.

It also fixes [GL #2884] (back-trace provided in the bug report is
exactly the same as was seen when fixing this problem).

lib/isc/netmgr/tlsdns.c

index 0d2828d4bfd4ee964294497f2610e44b6c1c3c71..72bb4ac4baac2f3e3e3b252e6e36b763a02de9f2 100644 (file)
@@ -940,6 +940,12 @@ isc__nm_tlsdns_processbuffer(isc_nmsocket_t *sock) {
                return (ISC_R_NOMORE);
        }
 
+       if (sock->recv_cb == NULL) {
+               /* recv_cb has been cleared - there is
+                * nothing to do */
+               return (ISC_R_CANCELED);
+       }
+
        req = isc__nm_get_read_req(sock, NULL);
        REQUIRE(VALID_UVREQ(req));