From: Artem Boldariev Date: Thu, 9 Sep 2021 13:52:55 +0000 (+0300) Subject: DoT: do not attempt to call read callback if it is not avaialble X-Git-Tag: v9.17.19~11^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=abecfdc298edfe2ef2c9d3d34742dcb80006a144;p=thirdparty%2Fbind9.git DoT: do not attempt to call read callback if it is not avaialble 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). --- diff --git a/lib/isc/netmgr/tlsdns.c b/lib/isc/netmgr/tlsdns.c index 0d2828d4bfd..72bb4ac4baa 100644 --- a/lib/isc/netmgr/tlsdns.c +++ b/lib/isc/netmgr/tlsdns.c @@ -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));