Temporary fix for SIGSEGV caused by authenticode parser.

See: https://github.com/avast/authenticode-parser/issues/19 for details.
This commit is contained in:
Victor M. Alvarez
2024-02-09 10:47:12 +01:00
parent 3342aa06f6
commit 9ff9c4c6ca
@@ -197,6 +197,12 @@ static void extract_ms_counter_certs(const uint8_t* data, int len, CertificateAr
if (!p7)
return;
/* We expect SignedData type of PKCS7 */
if (!PKCS7_type_is_signed(p7) || !p7->d.sign) {
PKCS7_free(p7);
return;
}
STACK_OF(X509)* certs = p7->d.sign->cert;
CertificateArray* certArr = certificate_array_new(sk_X509_num(certs));
if (!certArr) {