summaryrefslogtreecommitdiffstats
path: root/test/evp_test.c
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2021-08-27 13:11:39 +0200
committerBernd Edlinger <bernd.edlinger@hotmail.de>2021-08-28 16:49:25 +0200
commitdc3520b1ad3e1d70b899210bacc002318ebe276a (patch)
tree9723191ef3da91edf414db025cbf6a6a6c04c93f /test/evp_test.c
parent876b7e97b848ba179c1dbe4a4a265dfffae0eba6 (diff)
Fix the "Out of memory" EVP KDF scrypt test
This test did not really execute, since usually the OPENSSL_malloc(0) will fail and prevent the execution of the KDF. Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16446)
Diffstat (limited to 'test/evp_test.c')
-rw-r--r--test/evp_test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/evp_test.c b/test/evp_test.c
index abb51384e8..d4cca6dbcb 100644
--- a/test/evp_test.c
+++ b/test/evp_test.c
@@ -1777,7 +1777,7 @@ static int kdf_test_run(EVP_TEST *t)
unsigned char *got = NULL;
size_t got_len = expected->output_len;
- if (!TEST_ptr(got = OPENSSL_malloc(got_len))) {
+ if (!TEST_ptr(got = OPENSSL_malloc(got_len == 0 ? 1 : got_len))) {
t->err = "INTERNAL_ERROR";
goto err;
}