2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 14:07:59 +00:00

Fix a shutdown race in bin/dig/dighost.c

If a tool using the routines defined in bin/dig/dighost.c is sent an
interruption signal around the time a connection timeout is scheduled to
fire, connect_timeout() may be executed after destroy_libs() detaches
from the global task (setting 'global_task' to NULL), which results in a
crash upon a UDP retry due to bringup_timer() attempting to create a
timer with 'task' set to NULL.  Fix by preventing connect_timeout() from
attempting a retry when shutdown is in progress.
This commit is contained in:
Michał Kępień
2018-11-13 13:50:47 +01:00
parent 75cc4156e9
commit 4621756596

View File

@@ -2902,6 +2902,11 @@ connect_timeout(isc_task_t *task, isc_event_t *event) {
INSIST(!free_now);
if (cancel_now) {
UNLOCK_LOOKUP;
return;
}
if ((query != NULL) && (query->lookup->current_query != NULL) &&
ISC_LINK_LINKED(query->lookup->current_query, link) &&
(ISC_LIST_NEXT(query->lookup->current_query, link) != NULL)) {