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

From: Date: Wed, 25 Nov 2026 17:07:22 +0000
Subject: [php-src] master: Merge branch 'PHP-8.6'
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-144166@lists.php.net to get a copy of this message
Author: Jorg Sowa (jorgsowa) Date: 2026-11-25T18:03:28+01:00 Commit: https://github.com/php/php-src/commit/cd96297b9d1020ce2360d91fb8664da978fa3d24 Raw diff: https://github.com/php/php-src/commit/cd96297b9d1020ce2360d91fb8664da978fa3d24.diff Merge branch 'PHP-8.6' # Conflicts: # NEWS Changed paths: A sapi/fpm/tests/log-limit-above-buffer-errno-msg.phpt M sapi/fpm/fpm/zlog.c Diff: diff --git a/sapi/fpm/fpm/zlog.c b/sapi/fpm/fpm/zlog.c index f11618b94773..d5e28b4074f6 100644 --- a/sapi/fpm/fpm/zlog.c +++ b/sapi/fpm/fpm/zlog.c @@ -227,7 +227,7 @@ void vzlog(const char *function, int line, int flags, const char *fmt, va_list a if (flags & ZLOG_HAVE_ERRNO) { len += snprintf(buf + len, buf_size - len, ": %s (%d)", strerror(saved_errno), saved_errno); - if (len >= zlog_limit) { + if (len >= zlog_limit || len >= buf_size) { truncated = 1; } } diff --git a/sapi/fpm/tests/log-limit-above-buffer-errno-msg.phpt b/sapi/fpm/tests/log-limit-above-buffer-errno-msg.phpt new file mode 100644 index 000000000000..641d2ada4aa2 --- /dev/null +++ b/sapi/fpm/tests/log-limit-above-buffer-errno-msg.phpt @@ -0,0 +1,38 @@ +--TEST-- +FPM: Log message with errno is truncated to the buffer when log_limit is above it +--SKIPIF-- +<?php include "skipif.inc"; ?> +--FILE-- +<?php + +require_once "tester.inc"; + +/* The error line nearly fills the 2048-byte log buffer before errno text is appended. */ +$slowlog = '/' . str_repeat('a', 1970); + +$cfg = <<<EOT +[global] +error_log = {{FILE:LOG}} +log_limit = 4096 +[unconfined] +listen = {{ADDR}} +pm = static +pm.max_children = 1 +request_slowlog_timeout = 1 +slowlog = $slowlog +EOT; + +$tester = new FPM\Tester($cfg); +$tester->start(); +$tester->expectLogPattern('/^\[[^\]]+\] ERROR: Unable to create or open slowlog\(\/a{1970}\): .{7}\.\.\.$/'); +$tester->close(true); + +?> +Done +--EXPECT-- +Done +--CLEAN-- +<?php +require_once "tester.inc"; +FPM\Tester::clean(); +?>

« previous php.cvs (#144166) next »