aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTomas Mraz <tomas@openssl.org>2024-05-06 20:13:52 +0200
committerPauli <ppzgs1@gmail.com>2024-05-08 09:13:56 +1000
commitdeaa83af700113c99835a1db7d45d33baba05bd3 (patch)
tree0a00fcac1062aa3319620856b8a73c0a68545a11 /test
parent57bb112c07116d1cdbf5bc8562ebb3e7990f291c (diff)
downloadopenssl-deaa83af700113c99835a1db7d45d33baba05bd3.zip
openssl-deaa83af700113c99835a1db7d45d33baba05bd3.tar.gz
openssl-deaa83af700113c99835a1db7d45d33baba05bd3.tar.bz2
Fix Coverity issues 1596850, 1596851 and 1596852
These are newly introduced memory leaks and UAF in evp_test.c Reviewed-by: Neil Horman <nhorman@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/24339)
Diffstat (limited to 'test')
-rw-r--r--test/evp_test.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/evp_test.c b/test/evp_test.c
index 5da782d..21106dd 100644
--- a/test/evp_test.c
+++ b/test/evp_test.c
@@ -411,10 +411,10 @@ static int parse_bin_chunk(const char *value, size_t offset, size_t max,
return -1;
if (!TEST_ptr(*buf = OPENSSL_hexstr2buf(chunk, &len))) {
OPENSSL_free(chunk);
- TEST_info("Can't convert chunk %s", chunk);
TEST_openssl_errors();
return -1;
}
+ OPENSSL_free(chunk);
*buflen = len;
}
*out_offset = value[0] == '"' ? offset + (*buflen) : offset + 2 * (*buflen);
@@ -742,6 +742,8 @@ static int cipher_test_init(EVP_TEST *t, const char *alg)
if (data_chunk_size != 0 && !cipher_test_valid_fragmentation(cdat)) {
ERR_pop_to_mark();
+ EVP_CIPHER_free(fetched_cipher);
+ OPENSSL_free(cdat);
t->skip = 1;
TEST_info("skipping, '%s' does not support fragmentation", alg);
return 1;