mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-02-22 09:40:09 +00:00
Merge pull request #8188 from paul-elliott-arm/fix_pkcs7_use_uninit
Prevent potential use of uninitialised data in pkcs7 tests
This commit is contained in:
commit
bc519a59d0
@ -78,6 +78,8 @@ void pkcs7_verify(char *pkcs7_file,
|
|||||||
|
|
||||||
MD_OR_USE_PSA_INIT();
|
MD_OR_USE_PSA_INIT();
|
||||||
|
|
||||||
|
mbedtls_pkcs7_init(&pkcs7);
|
||||||
|
|
||||||
/* crt_files are space seprated list */
|
/* crt_files are space seprated list */
|
||||||
for (i = 0; i < strlen(crt_files); i++) {
|
for (i = 0; i < strlen(crt_files); i++) {
|
||||||
if (crt_files[i] == ' ') {
|
if (crt_files[i] == ' ') {
|
||||||
@ -100,7 +102,6 @@ void pkcs7_verify(char *pkcs7_file,
|
|||||||
i = k;
|
i = k;
|
||||||
}
|
}
|
||||||
|
|
||||||
mbedtls_pkcs7_init(&pkcs7);
|
|
||||||
for (i = 0; i < n_crts; i++) {
|
for (i = 0; i < n_crts; i++) {
|
||||||
TEST_CALLOC(crts[i], 1);
|
TEST_CALLOC(crts[i], 1);
|
||||||
mbedtls_x509_crt_init(crts[i]);
|
mbedtls_x509_crt_init(crts[i]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user