diff options
author | Zhou Qingyang <zhou1615@umn.edu> | 2022-01-25 01:37:59 +0800 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2022-01-28 15:07:16 +0100 |
commit | cb7e50ba3f250a9c9978a964e98a8c8940833595 (patch) | |
tree | 1af71e9ab2bae852121a85aadcd50002968d1a34 /providers/implementations | |
parent | e3b57c84320dae0aaa20aa0b4c356f10efae146b (diff) |
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 4dd085c03a885580cc945f71187131ea7fb39b70)
Diffstat (limited to 'providers/implementations')
-rw-r--r-- | providers/implementations/encode_decode/encode_key2text.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/providers/implementations/encode_decode/encode_key2text.c b/providers/implementations/encode_decode/encode_key2text.c index f8f9712e96..9455f97c4a 100644 --- a/providers/implementations/encode_decode/encode_key2text.c +++ b/providers/implementations/encode_decode/encode_key2text.c @@ -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; |