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

71683 Commits

Author SHA1 Message Date
Ilija Tovilo
48e318f581 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Tweak stack limit values for gh20840.phpt
  Tweak stack limit values for gh20583.phpt
2026-02-24 02:11:44 +01:00
Ilija Tovilo
f07809f495 Tweak stack limit values for gh20840.phpt
Graciously tested by Andy Postnikov (andypost).

See GH-21086
Closes GH-21275
2026-02-24 02:11:19 +01:00
Ilija Tovilo
9a6a841d77 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Tweak stack limit values for gh20583.phpt
2026-02-24 02:11:09 +01:00
Ilija Tovilo
3692a5fa57 Tweak stack limit values for gh20583.phpt
Graciously tested by Andy Postnikov (andypost).

See GH-21086
Closes GH-21274
2026-02-24 02:10:47 +01:00
David Carlier
92baeddd42 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  ext/pcntl: fix pcntl_signal_dispatch() stale tail pointer and exception handling.
2026-02-23 21:26:06 +00:00
David Carlier
296fad10fb ext/pcntl: fix pcntl_signal_dispatch() stale tail pointer and exception handling.
close GH-21259
2026-02-23 21:24:38 +00:00
David Carlier
aa44392dfc Fix GH-21262: ldap_modify() too strict controls argument validation.
make it impossible to unset an attribute.

close GH-21263
2026-02-23 20:46:04 +00:00
David Carlier
98258a3f5a Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  ext/pcntl: Fix signal table updated before php_signal4 succeeds in pcntl_signal
2026-02-23 12:48:30 +00:00
David Carlier
6a1bde5d38 ext/pcntl: Fix signal table updated before php_signal4 succeeds in pcntl_signal
Move the signal table update after the php_signal4 call, mirroring
what is already done in the SIG_DFL/SIG_IGN (integer) code path.
This prevents a stale entry in the table if sigaction fails.

close GH-21270
2026-02-23 12:47:55 +00:00
David Carlier
af5eae3427 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  ext/pcntl: Fix cpuset leak in pcntl_setcpuaffinity on out-of-range CPU ID
2026-02-22 19:58:41 +00:00
David Carlier
37ce67f276 ext/pcntl: Fix cpuset leak in pcntl_setcpuaffinity on out-of-range CPU ID
Add missing PCNTL_CPU_DESTROY(mask) call before RETURN_THROWS() when
the cpu id is out of range, matching the cleanup on other error paths.

close GH-21268
2026-02-22 19:57:19 +00:00
David Carlier
14bb2aa9c7 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  ext/pcntl: fix pcntl_setns() error handling.
2026-02-22 19:06:54 +00:00
David Carlier
e2a5909ba3 ext/pcntl: fix pcntl_setns() error handling.
Save errno into a local int before calling close(fd), as close() may
clobber errno on failure. Use int rather than errno_t because errno_t
is defined in C11 Annex K (bounds-checking interfaces) which is
optional and not widely implemented — many platforms (Linux/glibc,
musl, macOS, FreeBSD) do not provide it.

close GH-21256
2026-02-22 19:05:55 +00:00
Ilija Tovilo
27b41d310d [skip ci] Mark curl_persistent_share_002.phpt as not repeatable
The repeated request will re-use the connection from the first one, failing the
connect_time check.
2026-02-18 13:50:02 +01:00
ndossche
ed4ae182b5 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  curl: Don't truncate length
2026-02-17 23:16:25 +01:00
Niels Dossche
e2059a4697 curl: Don't truncate length
Truncating to an int seems dangerous, esp. in combination with a MIN
macro. I don't see a reason to truncate the length from size_t to int,
and especially no reason to change the signedness.

Closes GH-20747.
2026-02-17 23:15:55 +01:00
ndossche
e8a274e3dd Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Update NEWS for OpenSSL changes
  Fix memory leaks in openssl_cms_encrypt() when push fails
  Fix memory leaks in openssl_pkcs7_encrypt() when push fails
  Fix missing error propagation when php_array_to_X509_sk() fails
  Fix memory leaks in php_array_to_X509_sk() when push fails
  Fix memory leak in php_openssl_load_all_certs_from_file() when push fails

Closes GH-20986.
2026-02-17 21:46:49 +01:00
ndossche
f6887f04f6 Fix memory leaks in openssl_cms_encrypt() when push fails 2026-02-17 21:39:51 +01:00
ndossche
556ec77951 Fix memory leaks in openssl_pkcs7_encrypt() when push fails 2026-02-17 21:39:51 +01:00
ndossche
ef54becb3e Fix missing error propagation when php_array_to_X509_sk() fails
Execution shouldn't continue if this fails because it can give the wrong
results.
2026-02-17 21:39:51 +01:00
ndossche
01d598aea3 Fix memory leaks in php_array_to_X509_sk() when push fails 2026-02-17 21:39:50 +01:00
ndossche
4b9e80eae9 Fix memory leak in php_openssl_load_all_certs_from_file() when push fails 2026-02-17 21:39:50 +01:00
Ilija Tovilo
1da4480852 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix borked SCCP of array containing partial object
2026-02-17 18:12:09 +01:00
Ilija Tovilo
1931472f22 Fix borked SCCP of array containing partial object
In SCCP, arrays containing partial objects must be marked as partial so that
their values are not accidentally propagated.

Fixes GH-21227
Closes GH-21232
2026-02-17 18:11:28 +01:00
David Carlier
8ca6e13c2d Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  ext/pgsql: fix GH-21165 unit test.
2026-02-17 04:27:21 +00:00
David Carlier
f7af877cfe ext/pgsql: fix GH-21165 unit test.
making it fails early instead.

close GH-21234
2026-02-17 04:26:42 +00:00
Alex Dowad
e106d688c2 Merge branch 'PHP-8.4' into PHP-8.5 2026-02-17 06:48:37 +09:00
Jordi Kroon
37c5a13d67 replace alloca with do_alloca in mb_guess_encoding_for_strings
This avoids a crash in cases where the list of candidate encodings is so huge
that alloca would fail. Such crashes have been observed when the list of
encodings was larger than around 208,000 entries.
2026-02-17 06:46:42 +09:00
ndossche
b6ca14799d Fix merge for ext/sockets 2026-02-15 23:28:45 +01:00
David Carlier
15163debc5 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  ext/sockets: socket_sendto() add max addr length control for AF_UNIX.
2026-02-15 21:54:54 +00:00
David Carlier
b6495c189a ext/sockets: socket_sendto() add max addr length control for AF_UNIX.
we just mirror what is done for socket_connect()/AF_UNIX type.

close GH-21218
2026-02-15 21:54:19 +00:00
David Carlier
6c8a71b3b7 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-21162: pg_connect() on error memory leak.
2026-02-15 21:27:19 +00:00
David Carlier
539c5d9f76 Fix GH-21162: pg_connect() on error memory leak.
The PHP_PQ_ERROR macro calls php_error_docref() which triggers user error handlers
thus libpq does not have the chance to clean the resources (and empty
connections string are allowed) on failure thus we avoid this macro
and delay the error handling after.

close GH-21165
2026-02-15 21:26:23 +00:00
Dmitry Stogov
7273aa39c9 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Update IR (#21183)
2026-02-10 01:34:45 +03:00
Dmitry Stogov
dd9421d825 Update IR (#21183)
IR commit: a098f9ed6c2f1c2852d6c0921283212aafb4afed
2026-02-10 01:34:09 +03:00
David Carlier
1ff5eb448a Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-21161: socket_set_option() crash with array 'addr' entry as null.
2026-02-09 19:27:29 +00:00
David Carlier
19ee3e6697 Fix GH-21161: socket_set_option() crash with array 'addr' entry as null.
in the ipv6 address creation helper we need to use, for the error
message, the converted data rather than assuming the original
is a proper zend_string().

close GH-21166
2026-02-09 19:26:48 +00:00
Ilija Tovilo
81de7b964f Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Improve shared_alloc_shm.c strategy to support OPcache JIT on Solaris
2026-02-09 14:58:57 +01:00
Petr Sumbera
7c6f08945f Improve shared_alloc_shm.c strategy to support OPcache JIT on Solaris
The SysV shared memory allocator in OPcache hardcodes a maximum segment size of
32MB (SEG_ALLOC_SIZE_MAX). If the JIT buffer exceeds this, which it does with
the default 64MB size, startup will fail with "Insufficient shared memory!".

The allocator will now try allocating a contiguous buffer first, and only then
use segmentation by searching for continuously smaller powers of 2.

Fixes GH-20718
Closes GH-20719
2026-02-09 14:58:13 +01:00
Ilija Tovilo
ba6df41144 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix OSS-Fuzz #478009707 for JIT
2026-02-08 16:46:52 +01:00
Ilija Tovilo
bbde9c8178 Fix OSS-Fuzz #478009707 for JIT
This issue was already fixed in GH-21124, but some JIT paths were missing.

Closes GH-21151
2026-02-08 16:46:08 +01:00
ndossche
e76044aa0b Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix timezone offset with seconds losing precision
2026-02-05 18:39:18 +01:00
Niels Dossche
ee26417b58 Fix timezone offset with seconds losing precision
There are two issues:
1. The 'e' formatter doesn't output the seconds of the timezone even if
   it has seconds.
2. var_dump(), (array) cast, serialization, ... don't include the
   timezone second offset in the output. This means that, for example,
   serializing and then unserializing a date object loses the seconds of
   the timezone. This can be observed by comparing the output of
   getTimezone() for `$dt` vs the unserialized object in the provided test.

Closes GH-20764.
2026-02-05 18:38:54 +01:00
ndossche
34a341e59f Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-20936: DatePeriod::__set_state() cannot handle null start
2026-02-04 18:35:29 +01:00
Niels Dossche
7445b0f6d9 Fix GH-20936: DatePeriod::__set_state() cannot handle null start
The "current" and "end" field also rely on start_ce, which is set by
"start". Therefore, if "current" or "end" are provided, so must "start"
be provided.

Closes GH-20939.
2026-02-04 18:34:38 +01:00
Niels Dossche
52eb174ba6 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-21097: Accessing Dom\Node properties can can throw TypeError(s)
2026-02-03 18:40:54 +01:00
Niels Dossche
b8fc6bd1c8 Fix GH-21097: Accessing Dom\Node properties can can throw TypeError(s)
Split the handler again, or defer to instanceof when performance doesn't
matter.

Closes GH-21108.
2026-02-03 18:36:28 +01:00
Ilija Tovilo
9e96c5ff39 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Tweak zend.max_allowed_stack_size for gh20836_stack_limit.phpt
2026-02-03 00:54:56 +01:00
Ilija Tovilo
1f57d04648 Tweak zend.max_allowed_stack_size for gh20836_stack_limit.phpt
Fixes GH-21086
2026-02-03 00:54:25 +01:00
Niels Dossche
d54e5106b0 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-21077: Accessing Dom\Node::baseURI can throw TypeError
2026-01-30 18:14:19 +01:00