Add the missing check of BN_bn2hex return value

CLA: trivial

Signed-off-by: Zhou Qingyang <zhou1615@umn.edu>

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17578)

(cherry picked from commit 4dd085c03a)
This commit is contained in:
Zhou Qingyang 2022-01-25 01:37:59 +08:00 committed by Tomas Mraz
parent e3b57c8432
commit cb7e50ba3f
1 changed files with 3 additions and 0 deletions

View File

@ -80,6 +80,9 @@ static int print_labeled_bignum(BIO *out, const char *label, const BIGNUM *bn)
}
hex_str = BN_bn2hex(bn);
if (hex_str == NULL)
return 0;
p = hex_str;
if (*p == '-') {
++p;