]> 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>
Wed, 29 Sep 2021 01:43:14 +0000 (11:43 +1000)
Reorder REQUIRE checks to ensure ievent->sock is checked earlier

(cherry picked from commit 8fc9bb8e8ea357383e999d449f6d606811856e38)

lib/isc/netmgr/tcpdns.c

index c5843b328e1593de415ae571f26e7d43055d2c13..188790c8b4fa5e939379adef27708315b8103dc1 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;