1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Commit Graph

6481 Commits

Author SHA1 Message Date
Tim Düsterhus
a15ba7672c zend_ini: Make ZEND_INI_GET_ADDR() return a void* pointer (#21119)
* zend_ini: Make `ZEND_INI_GET_ADDR()` return a `void*` pointer

Since the actual type of the storage location is not known, a `void*` is more
appropriate and avoids explicit casts that are no more safe than the implicit
cast from `void*`.

* tree-wide: Remove explicit casts of `ZEND_INI_GET_ADDR()`

* UPGRADING.INTERNALS
2026-02-04 11:11:11 +01:00
Khaled Alam
32bd33983d Remove unreachable code after zend_error_noreturn calls (GH-20983) 2026-02-02 14:14:15 +01:00
Khaled Alam
d03d69a88a Remove duplicate #include statements (#21085)
* Remove duplicate #include statements across the codebase.

* feat: Restore conditional/unconditional include pairs in lscriu.c
2026-01-30 16:37:13 +01:00
Calvin Buckley
4d5b651e90 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix regression with header removal removing whole prefixes (#21020)
2026-01-28 16:50:26 -04:00
Calvin Buckley
cd32c597a7 Fix regression with header removal removing whole prefixes (#21020)
* Fix regression with header removing removing whole prefixes

The header removal code looked for the colon for key-value at the wrong
place, so it would overzealously remove headers. Tweak that condition,
and make the alternative condition only active if it's set (with the
remove prefix op case).

Fixes GH-21018.

* avoid reading past the actual length

* Rename variable to be more clear
2026-01-28 16:50:06 -04:00
Gina Peter Banyard
668606816f Zend: move class autoloading from SPL to Zend (#21001)
The primary motivation for this change is that this sort of functionality should reside in core and not in an extension.
The reason being is that this causes issues in regard to extension dependencies and resolution,
something that prevents GH-14544.
2026-01-28 01:57:30 +00:00
Volker Dusch
b5d3d8647f PHP-8.5 is now for PHP 8.5.4-dev 2026-01-27 17:37:51 +01:00
Arnaud Le Blanc
65b4073922 Include the actual stub name in generated arginfo headers (#20993) 2026-01-21 20:57:00 +01:00
Jordi Kroon
a7abaa012b always add PHP_MANDIR if exists (#20825) 2026-01-14 15:54:53 +01:00
Tim Düsterhus
265c0c632b Merge branch 'PHP-8.5'
* PHP-8.5:
  output: Fail starting to output buffer when the output layer is deactivated (#20846)
2026-01-10 14:38:37 +01:00
Tim Düsterhus
1f3390283d Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  output: Fail starting to output buffer when the output layer is deactivated (#20846)
2026-01-10 14:38:27 +01:00
Tim Düsterhus
b5d6377ada output: Fail starting to output buffer when the output layer is deactivated (#20846)
Fixes php/php-src#20837.
2026-01-10 14:37:52 +01:00
Niels Dossche
c518a6ba8b Merge branch 'PHP-8.5'
* PHP-8.5:
  fastcgi: Fix compile warning wrt safe_read() (#20887)
2026-01-10 10:49:57 +01:00
Niels Dossche
750c220550 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  fastcgi: Fix compile warning wrt safe_read() (#20887)
2026-01-10 10:49:51 +01:00
Niels Dossche
60b1f59081 fastcgi: Fix compile warning wrt safe_read() (#20887)
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) ||
      |                             ^~~
```
2026-01-10 10:49:37 +01:00
Niels Dossche
4c9bbaa79d Merge branch 'PHP-8.5'
* PHP-8.5:
  streams/memory: Ensure internal string is NUL terminated (#20812)
2026-01-02 18:03:41 +01:00
Niels Dossche
de1465e5ae Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  streams/memory: Ensure internal string is NUL terminated (#20812)
2026-01-02 18:03:36 +01:00
Niels Dossche
5484ebcc49 streams/memory: Ensure internal string is NUL terminated (#20812)
zend_string_truncate() doesn't put a NUL byte.
2026-01-02 18:03:17 +01:00
Jakub Zelenka
e49be5f8e2 Allow filtered streams to be casted as fd for select
This removes the artificial limitation that is not necessary. The fact
that some streams can have some data buffered is not a problem because
the similar situation is already present for OpenSSL streams where
OpenSSL can internally buffer data for the unprocessed part of the
record.

Closes GH-20540
2026-01-01 20:51:23 +01:00
Daniel Scherzer
daf4d54610 PHP-8.5 is now for PHP 8.5.3-dev 2025-12-30 14:27:29 -08:00
Jakub Zelenka
ab5c2a826a Use long conversion for stream context keepalive int values (#20805)
This is consistent with http and ssl wrappers where int values
are converted in this way.
2025-12-30 22:08:35 +01:00
Jakub Zelenka
c0be847a7e Prevent possible future precedence issues in PHP_SOCKVAL_IS_SET 2025-12-30 18:56:57 +01:00
Calvin Buckley
5726e53b39 PHP 8.4 is now for PHP 8.4.18-dev 2025-12-30 13:07:11 -04:00
Jakub Zelenka
0fd8aae6e8 Fix TCP_KEEPALIVE no inheriting for accepted sockets on MacOS 2025-12-30 16:53:22 +01:00
Jakub Zelenka
9582d8e6d7 Add stream socket keepalive context options
This adds so_keepalive, tcp_keepidle, tcp_keepintvl and tcp_keepcnt
stream socket context options that are used to set their upper case
C macro variants by setsockopt function.

The test requires sockets extension and just tests that the values are
being set. This is because a real test would be slow and difficult to
show that those options really work due to how they work internally.

Closes GH-20381
2025-12-30 16:52:22 +01:00
Niels Dossche
77eedd78ef Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-20352: UAF in php_output_handler_free via re-entrant ob_start() during error deactivation
2025-12-19 19:37:16 +01:00
Niels Dossche
c35224e11c Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-20352: UAF in php_output_handler_free via re-entrant ob_start() during error deactivation
2025-12-19 19:37:11 +01:00
Niels Dossche
0590a34aee Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-20352: UAF in php_output_handler_free via re-entrant ob_start() during error deactivation
2025-12-19 19:36:53 +01:00
Niels Dossche
ee0143887d Fix GH-20352: UAF in php_output_handler_free via re-entrant ob_start() during error deactivation
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.
2025-12-19 19:36:26 +01:00
Saki Takamachi
2ec8c29fda PHP-8.4 is now for PHP 8.4.17-dev 2025-12-03 14:52:20 +09:00
Eric Mann
e10f6d702f PHP-8.3 is now for PHP 8.3.30-dev 2025-12-02 09:05:38 -08:00
Volker Dusch
d8fbe40efb PHP-8.5 is now for PHP 8.5.2-dev 2025-12-02 12:14:28 +01:00
David Carlier
71d11bdb16 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-20601: ftp_connect() timeout argument overflow.
2025-11-29 23:06:41 +00:00
David Carlier
227541cb96 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-20601: ftp_connect() timeout argument overflow.
2025-11-29 23:06:15 +00:00
David Carlier
1701589884 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-20601: ftp_connect() timeout argument overflow.
2025-11-29 23:05:37 +00:00
David Carlier
4312a446d0 Fix GH-20601: ftp_connect() timeout argument overflow.
close GH-20603
2025-11-29 23:05:14 +00:00
Niels Dossche
eb733a3127 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-20286: use-after-destroy during userland stream_close()
2025-11-23 17:51:35 +01:00
Niels Dossche
27f17c3322 Fix GH-20286: use-after-destroy during userland stream_close()
Closes GH-20493.

Co-authored-by: David Carlier <devnexen@gmail.com>
2025-11-23 17:46:28 +01:00
Peter Kokot
88d811708b Remove PHP_HAVE_STREAMS (#20508)
This was once an indicator for PHP extensions whether PHP 4.3.0 or later
is used. Today, this is redundant.
2025-11-17 13:05:22 +01:00
Daniel Scherzer
3747e9393d Merge branch 'PHP-8.5'
* PHP-8.5:
  Revert "Deprecate returning non-string values from a user output handler (#18932)" (#20455)
2025-11-11 15:23:42 -08:00
Daniel Scherzer
2711864e82 Revert "Deprecate returning non-string values from a user output handler (#18932)" (#20455)
This partially reverts commit d8577d9bfb, and
reverts parts of 07f1cfd9b0.
2025-11-11 15:22:25 -08:00
Niels Dossche
d766a73c06 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix nightly failure due to OnChangeMemoryLimit changes (#20450)
2025-11-11 13:41:04 +01:00
Niels Dossche
ee9773bdc6 Fix nightly failure due to OnChangeMemoryLimit changes (#20450) 2025-11-11 13:40:04 +01:00
Ilija Tovilo
4227106f37 Merge branch 'PHP-8.5'
* PHP-8.5:
  Commit the actual fix for GH-17951
2025-11-11 01:45:29 +01:00
manuel
9b752a3d2b Commit the actual fix for GH-17951
Sorry, my (ilutov's) bad. I reverted the change to verify the test, but forgot
to undo before pushing.
2025-11-11 01:44:50 +01:00
Gina Peter Banyard
cf96153153 main.c: do not use printf variant if not needed (#20418) 2025-11-08 17:26:21 +00:00
Volker Dusch
78107c4a9a PHP 8.5 is now for PHP 8.5.1-dev 2025-11-04 19:55:56 +01:00
Calvin Buckley
57deb6c11b PHP 8.4 is now for PHP 8.4.16-dev
(Looks like this wasn't bumped for 8.4.15-dev previously)
2025-11-04 12:07:39 -04:00
Jakub Zelenka
17f253a1f2 PHP-8.3 is now for PHP 8.3.29-dev 2025-11-04 15:13:43 +01:00
David Carlier
f900035b27 network: on freebsd using SO_REUSEPORT_LB for a better distribution.
SO_REUSEPORT on FreeBSD acts differently as the underlying semantic
is different (as it predates Linux) since it s more for UDP/multicasts.
The SO_REUSEPORT_LB flag, however, uses load balancing for group
of address:port combinations which is how Linux is implemented.

Co-authored-by: Jakub Zelenka <bukka@php.net>
2025-11-03 13:39:18 +01:00