Commit 8dbf306663 for openssl.org
commit 8dbf306663c73f5bcc9e49b6edb1bc48d18ea7ff
Author: Neil Horman <nhorman@openssl.org>
Date: Fri Jan 16 15:33:11 2026 -0500
zero buffers in sslapitest
valgrind gripes about this, as its possible to reach the TEST_mem_eq
test without ever having initalized the buffer
Reviewed-by: Saša NedvÄ›dický <sashan@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Thu Jan 29 16:37:35 2026
(Merged from https://github.com/openssl/openssl/pull/29573)
diff --git a/test/sslapitest.c b/test/sslapitest.c
index 07a101313c..30dc17ce3c 100644
--- a/test/sslapitest.c
+++ b/test/sslapitest.c
@@ -9992,8 +9992,8 @@ static int test_multiblock_write(int test_index)
* i.e: write_len >= 4 * frag_size
* 9 * is chosen so that multiple multiblocks are used + some leftover.
*/
- unsigned char msg[MULTIBLOCK_FRAGSIZE * 9];
- unsigned char buf[sizeof(msg)], *p = buf;
+ unsigned char msg[MULTIBLOCK_FRAGSIZE * 9] = { 0 };
+ unsigned char buf[sizeof(msg)] = { 0 }, *p = buf;
size_t readbytes, written, len;
EVP_CIPHER *ciph = NULL;