]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Address use before NULL check warning of ievent->sock
authorMark Andrews <marka@isc.org>
Tue, 28 Sep 2021 00:12:31 +0000 (10:12 +1000)
committerMark Andrews <marka@isc.org>
Tue, 28 Sep 2021 01:57:47 +0000 (11:57 +1000)
Reorder REQUIRE checks to ensure ievent->sock is checked earlier

lib/isc/netmgr/tcpdns.c

index 11a7111b3ae5adfbdd37fa19a8352dd5d1fce58a..b5d2d248ce50a1c33aa72ed8e9a3dbdfa77a1370 100644 (file)
@@ -1110,10 +1110,9 @@ isc__nm_async_tcpdnssend(isc__networker_t *worker, isc__netievent_t *ev0) {
        isc__netievent_tcpdnssend_t *ievent =
                (isc__netievent_tcpdnssend_t *)ev0;
 
-       REQUIRE(ievent->sock->type == isc_nm_tcpdnssocket);
-       REQUIRE(ievent->sock->tid == isc_nm_tid());
-       REQUIRE(VALID_NMSOCK(ievent->sock));
        REQUIRE(VALID_UVREQ(ievent->req));
+       REQUIRE(VALID_NMSOCK(ievent->sock));
+       REQUIRE(ievent->sock->type == isc_nm_tcpdnssocket);
        REQUIRE(ievent->sock->tid == isc_nm_tid());
 
        isc_result_t result;