mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-31 03:07:29 +02:00
fix buffer overflow due to uninitialized idx variable
This commit is contained in:
@ -35001,8 +35001,10 @@ static int test_wc_dilithium_der(void)
|
|||||||
WC_NO_ERR_TRACE(BAD_FUNC_ARG));
|
WC_NO_ERR_TRACE(BAD_FUNC_ARG));
|
||||||
/* When security level is not set, we attempt to parse it from DER. Since
|
/* When security level is not set, we attempt to parse it from DER. Since
|
||||||
* the supplied DER is invalid, this should fail with ASN parsing error */
|
* the supplied DER is invalid, this should fail with ASN parsing error */
|
||||||
|
idx = 0;
|
||||||
ExpectIntEQ(wc_Dilithium_PublicKeyDecode(der, &idx, key, pubDerLen),
|
ExpectIntEQ(wc_Dilithium_PublicKeyDecode(der, &idx, key, pubDerLen),
|
||||||
WC_NO_ERR_TRACE(ASN_PARSE_E));
|
WC_NO_ERR_TRACE(ASN_PARSE_E));
|
||||||
|
idx = 0;
|
||||||
ExpectIntEQ(wc_Dilithium_PrivateKeyDecode(der, &idx, key, privDerLen),
|
ExpectIntEQ(wc_Dilithium_PrivateKeyDecode(der, &idx, key, privDerLen),
|
||||||
WC_NO_ERR_TRACE(ASN_PARSE_E));
|
WC_NO_ERR_TRACE(ASN_PARSE_E));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user