When building in strict mode (e.g. -std=c11), compilation of
main/debug_gdb_scripts.c fails because asm() is not a standard top level
statement. __asm__() however can be reserved by the compiler even in strict
mode.
Partially fixes GH-21215. IR needs a similar fix (dstogov/ir#128).
Closes GH-21226.
This shouldn't be const. Fixes the following warning:
```
warning: variable 'hdr' is uninitialized when passed as a const pointer argument here
[-Wuninitialized-const-pointer]
1054 | if (safe_read(req, &hdr, sizeof(fcgi_header)) != sizeof(fcgi_header) ||
| ^~~
```
The problem is that the code is doing `php_output_handler_free` in a loop on the output stack,
but prior to freeing the pointer on the stack in `php_output_handler_free` it calls
`php_output_handler_dtor` which can run user code that reallocates the stack,
resulting in a dangling pointer freed by php_output_handler_free.
Furthermore, OG(active) is set when creating a new output handler, but
the loop is supposed to clean up all handlers, so OG(active) must be
reset as well.
Closes GH-20356.
This fixes incorrect type conversion and subsequent check for Windows
where returned socket is not an int.
It should be noted that this is not really an issue as previous int
would get negative so the check should still work. The issue actually
happens only in master (PHP 8.5) where refactoring has been done and the
type changed.
Closes GH-19881
On Linux, these two character devices are exceptions in that they can be
seeked. Check their major/minor device number.
Co-authored-by: divinity76 <hans@loltek.net>
Change the reproducer code in `bug35916.phpt` from `stream_bucket_append` to
`stream_bucket_prepend` and you have the same bug.
Furthermore, even in the append case the check is incorrect because the bucket
can already be in the brigade at a position other than the tail.
To solve this properly, unlink the brigade first and also use that as a
condition to manage the refcount.
Closes GH-18973.
Or on Windows it is going to use either FormatMessageW or strerror_s
for compatibility with previous error messages.
It also needs to accomodate for GNU and BSD versions of strerror_r
returning different type.
Closes GH-19251
Since the ini message handlers already check for basedir, we need to
drop the basedir check from ini_set. Then we also fix the exceptional
case for the empty string: it should bypass the basedir check.
Furthermore, there was a regression introduced with the error_log
"syslog" check in ddfe269a (inverted check), so we fix that as well.
Closes GH-19487
PSFS_FEED_ME is supposed to be returned when the filter did not receive
enough data and did not generate buckets for the output brigade.
The test generates buckets anyway on the output brigade, and the stream
layer did not handle that case causing a memory leak.
To solve this, discard any such buckets as it would conflict with the
status code returned by the filter. This keeps BC and solves the leak.
Closes GH-18972.
This one is not initialized. This is not hittable from userspace code
because all locations within first-party php-src code have a valid
`option` argument.
Closes GH-19714.