summaryrefslogtreecommitdiffstats
path: root/test/evp_test.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2019-08-27 10:12:34 +0200
committerRichard Levitte <levitte@openssl.org>2019-08-27 18:55:01 +0200
commitd5f854291336c96a3d2379ecc8c29f00ef516ad9 (patch)
treee98be7d10b42811cf8e77b83ad041fa2c836e0a8 /test/evp_test.c
parent096978f09908ba0f679ff905b0db4861a57eb1c8 (diff)
Coverty fixes for MACs
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/9700)
Diffstat (limited to 'test/evp_test.c')
-rw-r--r--test/evp_test.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/evp_test.c b/test/evp_test.c
index 17b9fc0dfb..fd50c71354 100644
--- a/test/evp_test.c
+++ b/test/evp_test.c
@@ -1228,9 +1228,11 @@ static int mac_test_run_mac(EVP_TEST *t)
if (tmpval != NULL)
*tmpval++ = '\0';
- if (!OSSL_PARAM_allocate_from_text(&params[params_n], defined_params,
- tmpkey, tmpval,
- strlen(tmpval))) {
+ if (tmpval == NULL
+ || !OSSL_PARAM_allocate_from_text(&params[params_n],
+ defined_params,
+ tmpkey, tmpval,
+ strlen(tmpval))) {
OPENSSL_free(tmpkey);
t->err = "MAC_PARAM_ERROR";
goto err;