From: Artem Boldariev Date: Thu, 6 May 2021 12:14:04 +0000 (+0300) Subject: Fix crash in client side DoH code X-Git-Tag: v9.17.13~9^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a9e97f28b77340d4fb14e22cd5ad3088ecec8022;p=thirdparty%2Fbind9.git Fix crash in client side DoH code This commit fixes a situation when a cstream object could get unlinked from the list as a result of a cstream->read_cb call. Thus, unlinking it after the call could crash the program. --- diff --git a/lib/isc/netmgr/http.c b/lib/isc/netmgr/http.c index c2e403a5d02..9dc5e4d5c3c 100644 --- a/lib/isc/netmgr/http.c +++ b/lib/isc/netmgr/http.c @@ -528,10 +528,10 @@ call_unlink_cstream_readcb(http_cstream_t *cstream, isc_result_t result) { REQUIRE(VALID_HTTP2_SESSION(session)); REQUIRE(cstream != NULL); + ISC_LIST_UNLINK(session->cstreams, cstream, link); cstream->read_cb(session->handle, result, &(isc_region_t){ cstream->rbuf, cstream->rbufsize }, cstream->read_cbarg); - ISC_LIST_UNLINK(session->cstreams, cstream, link); put_http_cstream(session->mctx, cstream); }