]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Avoid aborting when uv_timer_start() is used on a closing socket
authorArtem Boldariev <artem@boldariev.com>
Tue, 10 May 2022 16:44:28 +0000 (19:44 +0300)
committerArtem Boldariev <artem@boldariev.com>
Fri, 20 May 2022 17:18:40 +0000 (20:18 +0300)
In such a case it will return UV_EINVAL (-EINVAL), leading to
aborting, as the code expects the function to succeed.

lib/isc/netmgr/netmgr.c

index b6ae1ca3192f2016b17e16424567058d0875d9af..ad9dc3d57fdb193ab22987183a479ca228c7795b 100644 (file)
@@ -2033,6 +2033,10 @@ void
 isc__nmsocket_timer_restart(isc_nmsocket_t *sock) {
        REQUIRE(VALID_NMSOCK(sock));
 
+       if (uv_is_closing((uv_handle_t *)&sock->read_timer)) {
+               return;
+       }
+
        if (atomic_load(&sock->connecting)) {
                int r;