[php-src] master: Merge branch 'PHP-8.5' into PHP-8.6

From: Date: Thu, 22 Oct 2026 14:37:43 +0000
Subject: [php-src] master: Merge branch 'PHP-8.5' into PHP-8.6
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-142581@lists.php.net to get a copy of this message
Author: ndossche (ndossche) Date: 2026-10-22T16:37:15+02:00 Commit: https://github.com/php/php-src/commit/1c5b0e5b128ca0c762ba554141dbca3245651005 Raw diff: https://github.com/php/php-src/commit/1c5b0e5b128ca0c762ba554141dbca3245651005.diff Merge branch 'PHP-8.5' into PHP-8.6 * PHP-8.5: Fix GH-24508: HTTP wrapper leaks dechunk filter when header parsing fails Changed paths: A ext/standard/tests/http/gh24508.phpt M NEWS M ext/standard/http_fopen_wrapper.c Diff: diff --git a/NEWS b/NEWS index 9f6000dfb911..899466752700 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,8 @@ PHP NEWS - Streams: . Fixed bug GH-24506 (stream_select() leaks a stream-error operation level on its FD_SETSIZE failure path). (azjezz) + . Fixed bug GH-24508 (HTTP wrapper leaks the dechunk filter when header + parsing fails after Transfer-Encoding). (bercedev) 21 Oct 2026, PHP 8.6.0RC4 diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c index 1ca79b172259..2eadc006a29e 100644 --- a/ext/standard/http_fopen_wrapper.c +++ b/ext/standard/http_fopen_wrapper.c @@ -1264,6 +1264,8 @@ static php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, if (stream->writepos > stream->readpos) { php_stream_notify_progress_increment(context, stream->writepos - stream->readpos, 0); } + } else if (header_info.transfer_encoding) { + php_stream_filter_free(header_info.transfer_encoding); } return stream; diff --git a/ext/standard/tests/http/gh24508.phpt b/ext/standard/tests/http/gh24508.phpt new file mode 100644 index 000000000000..33f31f474746 --- /dev/null +++ b/ext/standard/tests/http/gh24508.phpt @@ -0,0 +1,20 @@ +--TEST-- +GH-24508 (HTTP wrapper leaks the dechunk filter when header parsing fails after Transfer-Encoding) +--INI-- +allow_url_fopen=1 +--SKIPIF-- +<?php require 'server.inc'; http_server_skipif(); ?> +--FILE-- +<?php +require 'server.inc'; + +['pid' => $pid, 'uri' => $uri] = http_server([ + "data://text/plain,HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\nBrokenHeaderNoColon\r\n\r\n", +]); + +var_dump(@file_get_contents($uri)); + +http_server_kill($pid); +?> +--EXPECT-- +bool(false)

« previous php.cvs (#142581) next »