diff options
author | Pauli <ppzgs1@gmail.com> | 2021-03-19 09:41:34 +1000 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2021-03-26 08:46:02 +1000 |
commit | 27f37279df67abc2ed8239435042de86ae3c74ca (patch) | |
tree | c2761e2a072c51f2d83ae06f5a4711ee79977e82 /crypto/params_from_text.c | |
parent | 40d6e05cf8075e1f37aeb5ea1b49f47896f951fa (diff) | |
download | openssl-new-27f37279df67abc2ed8239435042de86ae3c74ca.tar.gz |
params: fix coverity 1473069: unchecked return values
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14615)
Diffstat (limited to 'crypto/params_from_text.c')
-rw-r--r-- | crypto/params_from_text.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crypto/params_from_text.c b/crypto/params_from_text.c index bf3ca61641..50f48fdb7e 100644 --- a/crypto/params_from_text.c +++ b/crypto/params_from_text.c @@ -29,6 +29,7 @@ static int prepare_from_text(const OSSL_PARAM *paramdefs, const char *key, { const OSSL_PARAM *p; size_t buf_bits; + int r; /* * ishex is used to translate legacy style string controls in hex format @@ -49,11 +50,11 @@ static int prepare_from_text(const OSSL_PARAM *paramdefs, const char *key, case OSSL_PARAM_INTEGER: case OSSL_PARAM_UNSIGNED_INTEGER: if (*ishex) - BN_hex2bn(tmpbn, value); + r = BN_hex2bn(tmpbn, value); else - BN_asc2bn(tmpbn, value); + r = BN_asc2bn(tmpbn, value); - if (*tmpbn == NULL) + if (r == 0 || *tmpbn == NULL) return 0; /* |