Skip to content

Commit e31b158

Browse files
committed
fix buffer overflow due to uninitialized idx variable
1 parent 04932dd commit e31b158

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

tests/api.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35001,8 +35001,10 @@ static int test_wc_dilithium_der(void)
3500135001
WC_NO_ERR_TRACE(BAD_FUNC_ARG));
3500235002
/* When security level is not set, we attempt to parse it from DER. Since
3500335003
* the supplied DER is invalid, this should fail with ASN parsing error */
35004+
idx = 0;
3500435005
ExpectIntEQ(wc_Dilithium_PublicKeyDecode(der, &idx, key, pubDerLen),
3500535006
WC_NO_ERR_TRACE(ASN_PARSE_E));
35007+
idx = 0;
3500635008
ExpectIntEQ(wc_Dilithium_PrivateKeyDecode(der, &idx, key, privDerLen),
3500735009
WC_NO_ERR_TRACE(ASN_PARSE_E));
3500835010

0 commit comments

Comments
 (0)