mirror of
https://github.com/isc-projects/bind9.git
synced 2026-02-25 19:04:57 -05:00
TLS: check for sock->recv_cb when handling received data
This commit adds a check if '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.
This commit is contained in:
parent
69db33e7a5
commit
bed5e2bb08
1 changed files with 14 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue