mirror of
https://github.com/php/php-src.git
synced 2024-11-27 03:44:07 +08:00
Fixed bug #60282 (Segfault when using ob_gzhandler() with open buffers)
This commit is contained in:
parent
bd7e9cfca1
commit
efd3e69511
@ -508,14 +508,14 @@ PHPAPI int php_output_handler_start(php_output_handler *handler TSRMLS_DC)
|
||||
* Check whether a certain output handler is in use */
|
||||
PHPAPI int php_output_handler_started(const char *name, size_t name_len TSRMLS_DC)
|
||||
{
|
||||
php_output_handler **handlers;
|
||||
php_output_handler ***handlers;
|
||||
int i, count = php_output_get_level(TSRMLS_C);
|
||||
|
||||
if (count) {
|
||||
handlers = *(php_output_handler ***) zend_stack_base(&OG(handlers));
|
||||
handlers = (php_output_handler ***) zend_stack_base(&OG(handlers));
|
||||
|
||||
for (i = 0; i < count; ++i) {
|
||||
if (name_len == handlers[i]->name_len && !memcmp(handlers[i]->name, name, name_len)) {
|
||||
if (name_len == (*(handlers[i]))->name_len && !memcmp((*(handlers[i]))->name, name, name_len)) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
10
tests/output/bug60282.phpt
Normal file
10
tests/output/bug60282.phpt
Normal file
@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
Bug #60282 (Segfault when using ob_gzhandler() with open buffers)
|
||||
--FILE--
|
||||
<?php
|
||||
ob_start();
|
||||
ob_start();
|
||||
ob_start('ob_gzhandler');
|
||||
echo "done";
|
||||
--EXPECT--
|
||||
done
|
Loading…
Reference in New Issue
Block a user