]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Silence GCC 12 NULL pointer dereference warnings
authorMark Andrews <marka@isc.org>
Wed, 8 Mar 2023 05:53:37 +0000 (16:53 +1100)
committerMark Andrews <marka@isc.org>
Wed, 8 Mar 2023 22:14:59 +0000 (22:14 +0000)
When isccc_cc_lookupstring returns ISC_R_SUCCESS the returned pointer
is non NULL.  Add INSISTS do that GCC 12 can determine this.

lib/isccc/cc.c

index 70d877fefc2ffeb25872db1850c020003569306b..4fec7f567b09a1ceaf9b063e8321740af7658413 100644 (file)
@@ -1003,12 +1003,14 @@ isccc_cc_checkdup(isccc_symtab_t *symtab, isccc_sexpr_t *message,
                _frm = "";
        } else {
                _frm = tmp;
+               INSIST(_frm != NULL);
        }
        tmp = NULL;
        if (isccc_cc_lookupstring(_ctrl, "_to", &tmp) != ISC_R_SUCCESS) {
                _to = "";
        } else {
                _to = tmp;
+               INSIST(_to != NULL);
        }
        /*
         * Ensure there is no newline in any of the strings.  This is so