]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
zero buffers in sslapitest
authorNeil Horman <nhorman@openssl.org>
Fri, 16 Jan 2026 20:33:11 +0000 (15:33 -0500)
committerNeil Horman <nhorman@openssl.org>
Thu, 29 Jan 2026 16:37:23 +0000 (11:37 -0500)
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)

test/sslapitest.c

index 07a101313c87d5d2a9e913e988955d9ea01f363c..30dc17ce3c14eae9996783742c1ed41d522287f9 100644 (file)
@@ -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;