From: Aram Sargsyan Date: Tue, 4 Apr 2023 12:34:35 +0000 (+0000) Subject: INSIST that openssleddsa_alg_info() is successful X-Git-Tag: v9.19.12~11^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=48c506c274425a13129c8c25e39c436dcba02f8f;p=thirdparty%2Fbind9.git INSIST that openssleddsa_alg_info() is successful In the check_algorithm() function openssleddsa_alg_info() is called with two known variants of the 'algorithm' argument, and both are expected to return a non-NULL value. Add an INSIST to suppress the following GCC 12 analyzer report: openssleddsa_link.c: In function 'raw_key_to_ossl': openssleddsa_link.c:92:13: error: dereference of NULL 'alginfo' [CWE-476] [-Werror=analyzer-null-dereference] 92 | int pkey_type = alginfo->pkey_type; | ^~~~~~~~~ --- diff --git a/lib/dns/openssleddsa_link.c b/lib/dns/openssleddsa_link.c index a547ac37d4e..142aa1623aa 100644 --- a/lib/dns/openssleddsa_link.c +++ b/lib/dns/openssleddsa_link.c @@ -633,6 +633,7 @@ check_algorithm(unsigned char algorithm) { DST_RET(ISC_R_NOTIMPLEMENTED); } + INSIST(alginfo != NULL); ret = raw_key_to_ossl(alginfo, 0, key, &key_len, &pkey); if (ret != ISC_R_SUCCESS) { goto err;