php-src/ext/zend_test
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
..
tests [skip ci] Fix overwritten observer ini setting for gh16514.phpt 2024-10-22 15:20:56 +02:00
config.m4 adds failing test case for #12060 2023-09-05 10:23:22 +01:00
config.w32 adds failing test case for #12060 2023-09-05 10:23:22 +01:00
fiber.c Fix segfault on debug_backtrace() in _ZendTestFiber 2024-10-14 14:04:49 +02:00
fiber.h Flexible fiber bailout handling (#7163) 2021-06-18 11:01:10 -05:00
fiber.stub.php Add support for validation of missing class synopses (#9472) 2022-09-05 14:21:15 +02:00
fiber_arginfo.h Add support for validation of missing class synopses (#9472) 2022-09-05 14:21:15 +02:00
iterators.c adds failing test case for #12060 2023-09-05 10:23:22 +01:00
iterators.h adds failing test case for #12060 2023-09-05 10:23:22 +01:00
iterators.stub.php adds failing test case for #12060 2023-09-05 10:23:22 +01:00
iterators_arginfo.h adds failing test case for #12060 2023-09-05 10:23:22 +01:00
observer.c Fix handling of nested generator in zend_test observer 2024-10-22 14:51:36 +02:00
observer.h Fix memory_leak in zend_test 2022-07-30 15:57:08 +00:00
php_test.h Merge branch 'PHP-8.1' into PHP-8.2 2023-11-25 00:59:26 +01:00
test.c Fix GH-16628: FPM logs are getting corrupted with this log statement 2024-11-02 19:36:20 +01:00
test.h Add support for generating namespaced constant 2023-02-23 10:05:30 +01:00
test.stub.php Fix GH-16628: FPM logs are getting corrupted with this log statement 2024-11-02 19:36:20 +01:00
test_arginfo.h Fix GH-16628: FPM logs are getting corrupted with this log statement 2024-11-02 19:36:20 +01:00