From: Mark Andrews Date: Mon, 26 Sep 2022 01:57:17 +0000 (+1000) Subject: Check that 'e' and 'n' are allocated in opensslrsa_fromdns X-Git-Tag: v9.19.6~26^2~3 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=db70c302138f02b6e1fca6e89cf2da35b2ca0ae4;p=thirdparty%2Fbind9.git Check that 'e' and 'n' are allocated in opensslrsa_fromdns --- diff --git a/lib/dns/opensslrsa_link.c b/lib/dns/opensslrsa_link.c index 64287854cc6..ce40ab1c318 100644 --- a/lib/dns/opensslrsa_link.c +++ b/lib/dns/opensslrsa_link.c @@ -692,6 +692,9 @@ opensslrsa_fromdns(dst_key_t *key, isc_buffer_t *data) { e = BN_bin2bn(r.base, e_bytes, NULL); isc_region_consume(&r, e_bytes); n = BN_bin2bn(r.base, r.length, NULL); + if (e == NULL || n == NULL) { + DST_RET(ISC_R_NOMEMORY); + } key->key_size = BN_num_bits(n);