]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Check that 'e' and 'n' are allocated in opensslrsa_fromdns
authorMark Andrews <marka@isc.org>
Mon, 26 Sep 2022 01:57:17 +0000 (11:57 +1000)
committerMark Andrews <marka@isc.org>
Tue, 27 Sep 2022 23:24:34 +0000 (09:24 +1000)
lib/dns/opensslrsa_link.c

index 64287854cc656d3b357220c3f00b8d988675e06f..ce40ab1c318d700c8f072e89ed4649c798793536 100644 (file)
@@ -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);