]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
params: fix coverity 1473069: unchecked return values
authorPauli <ppzgs1@gmail.com>
Thu, 18 Mar 2021 23:41:34 +0000 (09:41 +1000)
committerPauli <pauli@openssl.org>
Thu, 25 Mar 2021 22:46:02 +0000 (08:46 +1000)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14615)

crypto/params_from_text.c

index bf3ca616410fca785a6a8e81ba25b4c1c3648096..50f48fdb7e373449fc9051c6d60ebb8772fd580b 100644 (file)
@@ -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;
 
         /*