]> 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:49:04 +0000 (09:49 +1000)
(cherry picked from commit db70c302138f02b6e1fca6e89cf2da35b2ca0ae4)

lib/dns/opensslrsa_link.c

index 2cbcbfde1e1ed2c3d367fd9511fabcdbb0198205..c2b62afd347eb92b88db45d56d1864265e97306f 100644 (file)
@@ -687,6 +687,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);