diff --git a/lib/dns/opensslrsa_link.c b/lib/dns/opensslrsa_link.c index 64287854cc..ce40ab1c31 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);