mirror of
https://github.com/php/php-src.git
synced 2024-11-29 12:53:37 +08:00
- Fixed bug #61115 (stream related segfault on fatal error in
php_stream_context_link). #run-tests.php is not currently detecting the segfault in the test #Missing 5.4 merge
This commit is contained in:
parent
e391abb1d9
commit
cde7662226
13
ext/standard/tests/streams/bug61115.phpt
Normal file
13
ext/standard/tests/streams/bug61115.phpt
Normal file
@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Bug #61115: Stream related segfault on fatal error in php_stream_context_del_link.
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$arrayLarge = array_fill(0, 113663, '*');
|
||||
|
||||
$resourceFileTemp = fopen('php://temp', 'r+');
|
||||
stream_context_set_params($resourceFileTemp, array());
|
||||
preg_replace('', function() {}, $resourceFileTemp);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Catchable fatal error: Object of class Closure could not be converted to string in %s on line %d
|
@ -366,7 +366,9 @@ PHPAPI int _php_stream_free(php_stream *stream, int close_options TSRMLS_DC) /*
|
||||
int ret = 1;
|
||||
int preserve_handle = close_options & PHP_STREAM_FREE_PRESERVE_HANDLE ? 1 : 0;
|
||||
int release_cast = 1;
|
||||
php_stream_context *context = stream->context;
|
||||
/* on an unclean shutdown, the context may have already been freed (if it
|
||||
* was created after the stream resource), so don't reference it */
|
||||
php_stream_context *context = CG(unclean_shutdown) ? NULL : stream->context;
|
||||
|
||||
if (stream->flags & PHP_STREAM_FLAG_NO_CLOSE) {
|
||||
preserve_handle = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user