From 48c506c274425a13129c8c25e39c436dcba02f8f Mon Sep 17 00:00:00 2001 From: Aram Sargsyan Date: Tue, 4 Apr 2023 12:34:35 +0000 Subject: [PATCH] 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; | ^~~~~~~~~ --- lib/dns/openssleddsa_link.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/dns/openssleddsa_link.c b/lib/dns/openssleddsa_link.c index a547ac37d4..142aa1623a 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;