mirror of
https://github.com/php/php-src.git
synced 2026-04-16 20:41:18 +02:00
Merge branch 'PHP-7.1' of git.php.net:/php-src into PHP-7.1
* 'PHP-7.1' of git.php.net:/php-src: follow up fix on bug #74022 Fixed bug #74606 (Segfault within try/catch/finally nesting in Generators)
This commit is contained in:
29
Zend/tests/generators/bug74606.phpt
Normal file
29
Zend/tests/generators/bug74606.phpt
Normal file
@@ -0,0 +1,29 @@
|
||||
--TEST--
|
||||
Bug #74606 (Segfault within try/catch/finally nesting in Generators)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
$array = ["foo"];
|
||||
$array[] = "bar";
|
||||
|
||||
foreach ($array as $item) {
|
||||
try {
|
||||
try {
|
||||
yield;
|
||||
} finally {
|
||||
echo "fin $item\n";
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
echo "catch\n";
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
gen()->throw(new Exception);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
fin foo
|
||||
catch
|
||||
fin bar
|
||||
@@ -108,7 +108,7 @@ static void zend_generator_cleanup_unfinished_execution(
|
||||
if (UNEXPECTED(generator->frozen_call_stack)) {
|
||||
zend_generator_restore_call_stack(generator);
|
||||
}
|
||||
zend_cleanup_unfinished_execution(execute_data, op_num, 0);
|
||||
zend_cleanup_unfinished_execution(execute_data, op_num, catch_op_num);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -2941,6 +2941,7 @@ PHP_FUNCTION(openssl_pkcs12_read)
|
||||
|
||||
if (d2i_PKCS12_bio(bio_in, &p12) && PKCS12_parse(p12, pass, &pkey, &cert, &ca)) {
|
||||
BIO * bio_out;
|
||||
int cert_num;
|
||||
|
||||
zval_dtor(zout);
|
||||
array_init(zout);
|
||||
@@ -2971,10 +2972,11 @@ PHP_FUNCTION(openssl_pkcs12_read)
|
||||
BIO_free(bio_out);
|
||||
}
|
||||
|
||||
if (ca && sk_X509_num(ca)) {
|
||||
cert_num = sk_X509_num(ca);
|
||||
if (ca && cert_num) {
|
||||
array_init(&zextracerts);
|
||||
|
||||
for (i = 0; i < sk_X509_num(ca); i++) {
|
||||
for (i = 0; i < cert_num; i++) {
|
||||
zval zextracert;
|
||||
X509* aCA = sk_X509_pop(ca);
|
||||
if (!aCA) break;
|
||||
|
||||
24
ext/openssl/tests/bug74022_2.phpt
Normal file
24
ext/openssl/tests/bug74022_2.phpt
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user