mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-01 06:55:30 +00:00
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.
This commit is contained in:
@@ -528,10 +528,10 @@ call_unlink_cstream_readcb(http_cstream_t *cstream,
|
|||||||
isc_result_t result) {
|
isc_result_t result) {
|
||||||
REQUIRE(VALID_HTTP2_SESSION(session));
|
REQUIRE(VALID_HTTP2_SESSION(session));
|
||||||
REQUIRE(cstream != NULL);
|
REQUIRE(cstream != NULL);
|
||||||
|
ISC_LIST_UNLINK(session->cstreams, cstream, link);
|
||||||
cstream->read_cb(session->handle, result,
|
cstream->read_cb(session->handle, result,
|
||||||
&(isc_region_t){ cstream->rbuf, cstream->rbufsize },
|
&(isc_region_t){ cstream->rbuf, cstream->rbufsize },
|
||||||
cstream->read_cbarg);
|
cstream->read_cbarg);
|
||||||
ISC_LIST_UNLINK(session->cstreams, cstream, link);
|
|
||||||
put_http_cstream(session->mctx, cstream);
|
put_http_cstream(session->mctx, cstream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user