From f780901f5f7b8edf0dfeb8965ac790a0d83bfdcf Mon Sep 17 00:00:00 2001 From: Nicolas Iooss Date: Sun, 29 May 2022 16:38:23 +0200 Subject: [PATCH] Fix stack buffer overflow in AES-CBC test On x86-64, the AES-CBC test fails because the `vector` local buffer is to small to hold the encrypted test vector: the vector was created with 64 bytes while the buffer can only hold 48. Increase `TEST_VECTOR_OUTPUT_SIZE` to 64 to fix this issue. --- projects/WjCryptLibTest/WjCryptLibTest_AesCbc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/WjCryptLibTest/WjCryptLibTest_AesCbc.c b/projects/WjCryptLibTest/WjCryptLibTest_AesCbc.c index 5cd0ef1..9457526 100644 --- a/projects/WjCryptLibTest/WjCryptLibTest_AesCbc.c +++ b/projects/WjCryptLibTest/WjCryptLibTest_AesCbc.c @@ -88,7 +88,7 @@ static TestVector gTestVectors [] = }; #define NUM_TEST_VECTORS ( sizeof(gTestVectors) / sizeof(gTestVectors[0]) ) -#define TEST_VECTOR_OUTPUT_SIZE 48 +#define TEST_VECTOR_OUTPUT_SIZE 64 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // INTERNAL FUNCTIONS