php-src/sapi
Niels Dossche e643129bbb
Fix GH-16628: FPM logs are getting corrupted with this log statement
zlog_buf_prefix() can return a larger length than what actually was
written due to its use of snprintf(). The code in
zlog_stream_prefix_ex() does not take this into account, other callers
do. What ends up happening then is that stream->length is set to the
length as if snprintf() was able to write all bytes, causing
stream->length to become larger than stream->buf.size, causing a
segfault.

In case the buffer was too small we try with a larger buffer up to a
limit of zlog_limit. This makes sure that the stream length will remain
bounded by the buffer size.

This also adds assertions to make the programmer intent clear and catch
this more easily in debug builds.

Closes GH-16680.
2024-11-02 19:36:20 +01:00
..
apache2handler Merge branch 'PHP-8.1' into PHP-8.2 2022-12-13 15:24:07 +01:00
cgi Merge branch 'PHP-8.1' into PHP-8.2 2024-09-26 13:13:46 -05:00
cli Skip shebang in cli-server router script 2024-10-14 13:33:16 +02:00
embed Refacto php_module_startup() (#8303) 2022-04-27 23:07:11 +01:00
fpm Fix GH-16628: FPM logs are getting corrupted with this log statement 2024-11-02 19:36:20 +01:00
fuzzer Fix GH-13978: Fuzzer readme still mentions obsolete --enable-json flag (#13983) 2024-04-16 22:16:51 +02:00
litespeed Set libtool tag per command instead of global one 2024-01-10 09:09:45 +01:00
phpdbg Fix GH-16174: Empty string is an invalid expression for phpdbg-ev 2024-10-10 01:45:37 +02:00