Skip to content

Commit

Permalink
Uninitialized array variable
Browse files Browse the repository at this point in the history
array"key" is uninitialized and it is being read directly in function SipHash_Init() as per the below statements making a way for the garbage values :
uint64_t k0 = U8TO64_LE(k);
uint64_t k1 = U8TO64_LE(k + 8);

CLA: trivial

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from #23298)

(cherry picked from commit a0826b1)
  • Loading branch information
shashankmca80 authored and t8m committed Jan 19, 2024
1 parent b7275c5 commit 90b3757
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/siphash_internal_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ static int test_siphash(int idx)
static int test_siphash_basic(void)
{
SIPHASH siphash = { 0, };
unsigned char key[SIPHASH_KEY_SIZE];
static const unsigned char key[SIPHASH_KEY_SIZE] = {0};
unsigned char output[SIPHASH_MAX_DIGEST_SIZE];

/* Use invalid hash size */
Expand Down

0 comments on commit 90b3757

Please sign in to comment.