Skip to content

Commit ef54bec

Browse files
committed
Fix missing error propagation when php_array_to_X509_sk() fails
Execution shouldn't continue if this fails because it can give the wrong results.
1 parent 01d598a commit ef54bec

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

ext/openssl/openssl.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2684,6 +2684,9 @@ PHP_FUNCTION(openssl_pkcs12_export_to_file)
26842684

26852685
if (args && (item = zend_hash_str_find(Z_ARRVAL_P(args), "extracerts", sizeof("extracerts")-1)) != NULL) {
26862686
ca = php_array_to_X509_sk(item, 5, "extracerts");
2687+
if (!ca) {
2688+
goto cleanup;
2689+
}
26872690
}
26882691
/* end parse extra config */
26892692

@@ -2777,6 +2780,9 @@ PHP_FUNCTION(openssl_pkcs12_export)
27772780

27782781
if (args && (item = zend_hash_str_find(Z_ARRVAL_P(args), "extracerts", sizeof("extracerts")-1)) != NULL) {
27792782
ca = php_array_to_X509_sk(item, 5, "extracerts");
2783+
if (!ca) {
2784+
goto cleanup;
2785+
}
27802786
}
27812787
/* end parse extra config */
27822788

0 commit comments

Comments
 (0)