mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00
Fixed bug #60282 (Segfault when using ob_gzhandler() with open buffers)
This commit is contained in:
parent
bd7e9cfca1
commit
efd3e69511
2 changed files with 13 additions and 3 deletions
|
@ -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 */
|
* Check whether a certain output handler is in use */
|
||||||
PHPAPI int php_output_handler_started(const char *name, size_t name_len TSRMLS_DC)
|
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);
|
int i, count = php_output_get_level(TSRMLS_C);
|
||||||
|
|
||||||
if (count) {
|
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) {
|
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;
|
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…
Add table
Add a link
Reference in a new issue