]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
param build: add errors to failure returns
authorPauli <pauli@openssl.org>
Mon, 10 Jan 2022 00:31:45 +0000 (11:31 +1100)
committerPauli <pauli@openssl.org>
Wed, 12 Jan 2022 09:10:21 +0000 (20:10 +1100)
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17440)

crypto/param_build.c

index eaece0026dea2186da710a0d54e70f07d34a0d2a..a86f4baf173fb8e332822572d40ed69996fcb4fb 100644 (file)
@@ -78,8 +78,10 @@ static int param_push_num(OSSL_PARAM_BLD *bld, const char *key,
 {
     OSSL_PARAM_BLD_DEF *pd = param_push(bld, key, size, size, type, 0);
 
-    if (pd == NULL)
+    if (pd == NULL) {
+        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
         return 0;
+    }
     if (size > sizeof(pd->num)) {
         ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_TOO_MANY_BYTES);
         return 0;