]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Add the missing check of BN_bn2hex return value
authorZhou Qingyang <zhou1615@umn.edu>
Mon, 24 Jan 2022 17:37:59 +0000 (01:37 +0800)
committerTomas Mraz <tomas@openssl.org>
Fri, 28 Jan 2022 14:06:23 +0000 (15:06 +0100)
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)

providers/implementations/encode_decode/encode_key2text.c

index f8f9712e9618bc34738db5c5c54b25a44c7d249f..9455f97c4a9bb634fcd858746b0672613513ab4c 100644 (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;