]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Check the return value from uv_async_send()
authorTony Finch <fanf@isc.org>
Mon, 15 May 2023 14:35:57 +0000 (15:35 +0100)
committerTony Finch <fanf@isc.org>
Mon, 15 May 2023 17:52:04 +0000 (18:52 +0100)
An omission pointed out by the following report from Coverity:

    /lib/isc/loop.c: 483 in isc_loopmgr_pause()
    >>>     CID 455002:  Error handling issues  (CHECKED_RETURN)
    >>>     Calling "uv_async_send" without checking return value (as is done elsewhere 5 out of 6 times).
    483      uv_async_send(&loop->pause_trigger);

lib/isc/loop.c

index 0b3918a00f359d27ef363f5dfde0c5e55b12c16e..ddbc83d37b6ec09cea04545647e90b30dd9ef41f 100644 (file)
@@ -480,7 +480,8 @@ isc_loopmgr_pause(isc_loopmgr_t *loopmgr) {
                        continue;
                }
 
-               uv_async_send(&loop->pause_trigger);
+               int r = uv_async_send(&loop->pause_trigger);
+               UV_RUNTIME_CHECK(uv_async_send, r);
        }
 
        RUNTIME_CHECK(atomic_compare_exchange_strong(&loopmgr->paused,