From 1f8fd95dbf7121102f8fd4c4ebfe3b9c1037943a Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 9 Mar 2017 20:48:26 +0100 Subject: [PATCH] fixed uninitialised memory read in chacha20 test code --- libretroshare/src/crypto/chacha20.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libretroshare/src/crypto/chacha20.cpp b/libretroshare/src/crypto/chacha20.cpp index ed26b1b42..5a265b514 100644 --- a/libretroshare/src/crypto/chacha20.cpp +++ b/libretroshare/src/crypto/chacha20.cpp @@ -1231,6 +1231,8 @@ bool perform_tests() uint32_t SIZE = 1*1024*1024 ; uint8_t *ten_megabyte_data = (uint8_t*)malloc(SIZE) ; + memset(ten_megabyte_data,0x37,SIZE) ; // put something. We dont really care here. + uint8_t key[32] = { 0x1c,0x92,0x40,0xa5,0xeb,0x55,0xd3,0x8a,0xf3,0x33,0x88,0x86,0x04,0xf6,0xb5,0xf0, 0x47,0x39,0x17,0xc1,0x40,0x2b,0x80,0x09,0x9d,0xca,0x5c,0xbc,0x20,0x70,0x75,0xc0 };