From 2b18f6699b6cdbf0772fa0c7caf4bc78d8458f71 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 8 Mar 2023 16:53:37 +1100 Subject: [PATCH] Silence GCC 12 NULL pointer dereference warnings 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 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/isccc/cc.c b/lib/isccc/cc.c index 70d877fefc..4fec7f567b 100644 --- a/lib/isccc/cc.c +++ b/lib/isccc/cc.c @@ -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