Skip to content

Commit 2fc2a53

Browse files
Fix missing return code check in wc_PKCS12_parse_ex.
Thanks to Zou Dikai for the report.
1 parent fa9f24f commit 2fc2a53

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

wolfcrypt/src/pkcs12.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1546,8 +1546,13 @@ int wc_PKCS12_parse_ex(WC_PKCS12* pkcs12, const char* psw,
15461546
*pkeySz = (word32)size;
15471547
}
15481548
else {
1549-
*pkeySz = (word32)ToTraditional_ex(*pkey,
1549+
ret = ToTraditional_ex(*pkey,
15501550
(word32)size, &algId);
1551+
if (ret < 0) {
1552+
goto exit_pk12par;
1553+
} else {
1554+
*pkeySz = (word32)ret;
1555+
}
15511556
}
15521557
}
15531558

0 commit comments

Comments
 (0)