Merge branch 'artem-tls-check-for-recv_cb' into 'main'

TLS: check for sock->recv_cb when handling received data

See merge request isc-projects/bind9!7158
This commit is contained in:
Artem Boldariev 2022-12-02 12:11:41 +00:00
commit e3ffe756dc

View file

@ -547,6 +547,20 @@ tls_do_bio(isc_nmsocket_t *sock, isc_region_t *received_data,
if (sock->statichandle == NULL) {
finish = true;
break;
} else if (sock->recv_cb == NULL) {
/*
* The 'sock->recv_cb' might have been
* nullified during the call to
* 'sock->recv_cb'. That could happen,
* e.g. by an indirect call to
* 'isc_nmhandle_close()' from within
* the callback when wrapping up.
*
* In this case, let's close the TLS
* connection.
*/
finish = true;
break;
} else if (!sock->reading) {
/*
* Reading has been paused from withing