Skip to content

Commit cfd93b1

Browse files
committed
tests/api.c: fix error path uninited-data defects in test_wc_PKCS7_EncodeSignedData() (followup to bf95f80, detected by valgrind).
1 parent 1fb8f5f commit cfd93b1

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tests/api.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15772,11 +15772,13 @@ static int test_wc_PKCS7_EncodeSignedData(void)
1577215772
{
1577315773
int signedSz = 0, i;
1577415774
encodeSignedDataStream strm;
15775-
int numberOfChunkSizes = 4;
15776-
word32 chunkSizes[] = { 4080, 4096, 5000, 9999 };
15775+
static const int numberOfChunkSizes = 4;
15776+
static const word32 chunkSizes[] = { 4080, 4096, 5000, 9999 };
1577715777
/* chunkSizes were chosen to test around the default 4096 octet string
1577815778
* size used in pkcs7.c */
1577915779

15780+
XMEMSET(&strm, 0, sizeof(strm));
15781+
1578015782
ExpectNotNull(pkcs7 = wc_PKCS7_New(HEAP_HINT, testDevId));
1578115783
ExpectIntEQ(wc_PKCS7_Init(pkcs7, HEAP_HINT, INVALID_DEVID), 0);
1578215784

0 commit comments

Comments
 (0)