mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2: Fix GH-14808: Unexpected null pointer in Zend/zend_string.h with empty output buffer
This commit is contained in:
4
NEWS
4
NEWS
@@ -16,6 +16,10 @@ PHP NEWS
|
|||||||
- LibXML:
|
- LibXML:
|
||||||
. Fixed bug GH-14563 (Build failure with libxml2 v2.13.0). (nielsdos)
|
. Fixed bug GH-14563 (Build failure with libxml2 v2.13.0). (nielsdos)
|
||||||
|
|
||||||
|
- Output:
|
||||||
|
. Fixed bug GH-14808 (Unexpected null pointer in Zend/zend_string.h with
|
||||||
|
empty output buffer). (nielsdos)
|
||||||
|
|
||||||
- PDO:
|
- PDO:
|
||||||
. Fixed bug GH-14712 (Crash with PDORow access to null property).
|
. Fixed bug GH-14712 (Crash with PDORow access to null property).
|
||||||
(David Carlier)
|
(David Carlier)
|
||||||
|
|||||||
@@ -360,7 +360,11 @@ PHPAPI int php_output_get_level(void)
|
|||||||
PHPAPI int php_output_get_contents(zval *p)
|
PHPAPI int php_output_get_contents(zval *p)
|
||||||
{
|
{
|
||||||
if (OG(active)) {
|
if (OG(active)) {
|
||||||
ZVAL_STRINGL(p, OG(active)->buffer.data, OG(active)->buffer.used);
|
if (OG(active)->buffer.used) {
|
||||||
|
ZVAL_STRINGL(p, OG(active)->buffer.data, OG(active)->buffer.used);
|
||||||
|
} else {
|
||||||
|
ZVAL_EMPTY_STRING(p);
|
||||||
|
}
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
} else {
|
} else {
|
||||||
ZVAL_NULL(p);
|
ZVAL_NULL(p);
|
||||||
|
|||||||
13
tests/output/gh14808.phpt
Normal file
13
tests/output/gh14808.phpt
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
--TEST--
|
||||||
|
GH-14808 (Unexpected null pointer in Zend/zend_string.h with empty output buffer)
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
var_dump($args);
|
||||||
|
ob_start('ob_iconv_handler');
|
||||||
|
ob_clean();
|
||||||
|
var_dump(ob_get_contents());
|
||||||
|
?>
|
||||||
|
--EXPECTF--
|
||||||
|
Warning: Undefined variable $args in %s on line %d
|
||||||
|
NULL
|
||||||
|
string(0) ""
|
||||||
Reference in New Issue
Block a user