1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

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.
This commit is contained in:
ndossche
2026-01-20 15:14:25 +01:00
committed by ndossche
parent 01d598aea3
commit ef54becb3e

View File

@@ -2684,6 +2684,9 @@ PHP_FUNCTION(openssl_pkcs12_export_to_file)
if (args && (item = zend_hash_str_find(Z_ARRVAL_P(args), "extracerts", sizeof("extracerts")-1)) != NULL) {
ca = php_array_to_X509_sk(item, 5, "extracerts");
if (!ca) {
goto cleanup;
}
}
/* end parse extra config */
@@ -2777,6 +2780,9 @@ PHP_FUNCTION(openssl_pkcs12_export)
if (args && (item = zend_hash_str_find(Z_ARRVAL_P(args), "extracerts", sizeof("extracerts")-1)) != NULL) {
ca = php_array_to_X509_sk(item, 5, "extracerts");
if (!ca) {
goto cleanup;
}
}
/* end parse extra config */