Commit graph

65382 commits

Author SHA1 Message Date
David Carlier
2636104a83
Merge branch 'PHP-8.2' into PHP-8.3 2024-04-20 17:11:33 +01:00
David Carlier
42443b4c2e
ext/session: fix _read/_write buffer limit.
MSDN pages mention the buffer size upper limit is INT_MAX not UINT_MAX.
inspired by GH-13205.

Close GH-14017
2024-04-20 17:11:03 +01:00
Saki Takamachi
43064160c4
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-13998: Manage refcount of agg_context->val correctly (#14004)
2024-04-20 22:34:31 +09:00
Saki Takamachi
2a1aa8cac5
Fix GH-13998: Manage refcount of agg_context->val correctly (#14004)
When step_callback fails, agg_context->val is passed dtor, but agg_context->val
is also used in final_callback regardless of the success/failure of step_callback,
so should not call dtor.

closes #14004
fixes #13998
2024-04-20 22:33:25 +09:00
Jakub Zelenka
353571e29b
Merge branch 'PHP-8.2' into PHP-8.3 2024-04-19 14:09:53 +01:00
Jakub Zelenka
04b864e566
Fix GH-13806: openssl_x509_parse_basic test fails with OpenSSL 3.2+ (#13961)
Closes GH-13961
2024-04-19 14:09:22 +01:00
David Carlier
e94f3a7b40
Merge branch 'PHP-8.2' into PHP-8.3 2024-04-19 10:07:11 +01:00
David Carlier
cc46a4e6b5
ext/intl: level up c++ runtime std for icu 74 and onwards.
to align with what is required to build icu 74 itself.

Close GH-14002
2024-04-19 10:04:25 +01:00
Saki Takamachi
dd5cdfd645
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-13984: Buffer size is now checked before memcmp (#13991)
2024-04-18 08:37:55 +09:00
Saki Takamachi
fda91a0543
Fix GH-13984: Buffer size is now checked before memcmp (#13991)
Fixed an issue where a buffer overflow occurred when a string shorter than
`:memory:` was passed as the db name of pdo_sqlite.

fixed #13984
closes #13991
2024-04-18 08:35:50 +09:00
Arnaud Le Blanc
c12fd0873b
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [ci skip] NEWS
  fix: zend-max-execution-timers with negative or high timeout value (#13942)
  Use return value of getpwuid_r(), not errno (#13969)
2024-04-16 14:19:35 +02:00
Arnaud Le Blanc
32efc76c32
Use return value of getpwuid_r(), not errno (#13969) 2024-04-16 14:08:28 +02:00
Ilija Tovilo
f06a755848
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix clean section in test
2024-04-15 14:15:09 +02:00
Ilija Tovilo
a7a7e6d57c
Fix clean section in test 2024-04-15 14:14:47 +02:00
Ilija Tovilo
df4d59e43d
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix rename test file name collision
2024-04-15 13:43:06 +02:00
Ilija Tovilo
f2cd0d5752
Fix rename test file name collision 2024-04-15 13:42:40 +02:00
Jakub Zelenka
4dad74f250
Merge branch 'PHP-8.2' into PHP-8.3 2024-04-14 14:27:05 +01:00
Damian Wójcik
8421cfda61
Fix file_get_contents() on Windows fails with "errno=22 Invalid argument"
Closes GH-13948
2024-04-14 14:26:10 +01:00
Jakub Zelenka
fbcad699cb
Merge branch 'PHP-8.2' into PHP-8.3 2024-04-12 10:57:42 +01:00
Jakub Zelenka
3b93f13199
Revert "ext/mysqlnd: support ER_CLIENT_INTERACTION_TIMEOUT"
This reverts commit 5035b85090.

This broke Doctrine DBAL tests - more discussion in GH-13618.
2024-04-12 10:56:09 +01:00
Michael Orlitzky
4ded247675
ext/fileinfo/tests/bug78987.phpt: increase a memory limit
This test performs a few checks to ensure that "not too much" memory
is used while fileinfo is detecting encodings. It is however platform
specific, and memory usage varies across hosts and as libmagic changes.

Recently a Gentoo user reported a failure in this test at,

  https://bugs.gentoo.org/927461

on a big-endian PPC64 machine with output,

  ---- EXPECTED OUTPUT
  131072   => ok
  262144   => ok
  524288   => ok
  1048576  => ok
  2097152  => ok
  4194304  => ok
  8388608  => ok
  16777216 => ok
  ---- ACTUAL OUTPUT
  131072   => 10092544
  262144   => 10092544
  524288   => 12189696
  1048576  => 12189696
  2097152  => 14352384
  4194304  => 18612224
  8388608  => 24903680
  16777216 => 37486592
  ---- FAILED

Those numbers are with 8.3.4 and therefore missing commit b7c5813c
which also raises the limits. Checking the "actual" numbers above
against the current values, we see that the limit for 524288 would
need to be bumped to 12189696 to allow this test to pass. Since that
seems reasonable, that's what this commit does.

Closes GH-13795
Closes GH-13940
2024-04-11 15:58:06 +02:00
Arnaud Le Blanc
d986b5c66d Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [ci skip] NEWS
  Fix usage of reentrant functions in ext/posix (#13921)
2024-04-11 13:29:49 +02:00
Arnaud Le Blanc
66809c05b7
Fix usage of reentrant functions in ext/posix (#13921)
- It's not necessarily an error of sysconf(_SC_GETPW_R_SIZE_MAX) returns -1, as
  specified by posix (and the musl implementation always returns -1). Pick an
  initial buffer size in this case.
- Reentrant variants return an error number an may not set errno
- Implement retry logic for ttyname_r()
- Fix retry logic for getpwnam_r() (pw would be NULL after the first try)
- Test retry logic by setting the initial buffer size to 1 in debug builds
2024-04-11 13:27:39 +02:00
Bob Weinand
639a0d78d7 Merge branch 'PHP-8.2' of https://github.com/php/php-src into PHP-8.3 2024-04-10 20:38:23 +02:00
Bob Weinand
ea927caffa
Fix exception IP in JIT (#13929) 2024-04-10 20:37:54 +02:00
Kamil Tekiela
acf9047346
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  ext/mysqlnd: support ER_CLIENT_INTERACTION_TIMEOUT
2024-04-10 13:35:14 +02:00
Appla
5035b85090
ext/mysqlnd: support ER_CLIENT_INTERACTION_TIMEOUT
Closes GH-13618.
2024-04-10 13:33:04 +02:00
David Carlier
2cfd9df109
Fix GH-13932: Attempt to fix mbstring on windows build (msvc).
Build failure due to lack of VLA support in older compiler versions.
2024-04-10 10:01:11 +01:00
Niels Dossche
c7c1336d0a
Adapt regression test 2024-04-09 23:52:19 -05:00
Alex Dowad
3394efc63e
Fix infinite loop in mb_encode_mimeheader 2024-04-09 23:52:11 -05:00
Ben Ramsey
3d9941fd1e
Merge branch 'PHP-8.2' into PHP-8.3 2024-04-09 23:49:53 -05:00
Ben Ramsey
a9ffc447a4
Merge branch 'PHP-8.1' into PHP-8.2 2024-04-09 23:49:31 -05:00
Jakub Zelenka
0ba5229a3f
Fix bug GHSA-q6x7-frmf-grcw: password_verify can erroneously return true
Disallow null character in bcrypt password
2024-04-09 23:38:32 -05:00
Niels Dossche
093c08af25
Fix GHSA-wpj3-hf5j-x4v4: __Host-/__Secure- cookie bypass due to partial CVE-2022-31629 fix
The check happened too early as later code paths may perform more
mangling rules. Move the check downwards right before adding the actual
variable.
2024-04-09 23:37:06 -05:00
Jakub Zelenka
e3c784f2bf
Add proc_open escaping for cmd file execution 2024-04-09 23:29:28 -05:00
Bob Weinand
5ead5c5a11 Merge branch 'PHP-8.2' into PHP-8.3 2024-04-08 20:19:46 +02:00
Bob Weinand
e48a5c14b9 Add zend_test.observer.enabled=0 to opcache tests asserting specific TMP count
Necessary to succeed when tests are run with zend_test.observer.enabled=1.
2024-04-08 20:16:35 +02:00
Niels Dossche
07fe3b2920
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix potential NULL pointer dereference before calling EVP_SignInit
2024-04-08 19:31:13 +02:00
icy17
6f8bda0582
Fix potential NULL pointer dereference before calling EVP_SignInit
Closes GH-13870.
2024-04-08 19:30:26 +02:00
Bob Weinand
f52b2a9cdc Merge branch 'PHP-8.2' into PHP-8.3 2024-04-08 15:10:29 +02:00
Bob Weinand
af098acd6e Always load EX(opline) into the current frame in JIT when observers are enabled
Fixes #13772.
Closes #13776.
2024-04-08 15:09:14 +02:00
Niels Dossche
73218e063a
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Improve stability of test gh13860.phpt
2024-04-07 22:50:09 +02:00
Niels Dossche
a86256c950
Improve stability of test gh13860.phpt 2024-04-07 22:49:58 +02:00
Niels Dossche
92136640aa
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-13860: Incorrect PHP_STREAM_OPTION_CHECK_LIVENESS case in ext/openssl/xp_ssl.c - causing use of dead socket
2024-04-07 21:37:01 +02:00
Niels Dossche
2aae14c8a9
Fix GH-13860: Incorrect PHP_STREAM_OPTION_CHECK_LIVENESS case in ext/openssl/xp_ssl.c - causing use of dead socket
php_socket_errno() may return a stale value when recv returns a
value >= 0. As such, the liveness check is wrong.
This is the same bug as #70198 (fixed in GH-1456). So we fix it in the
same way.

Closes GH-13895.
2024-04-07 21:35:43 +02:00
Niels Dossche
6c7707e918
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix persistent local flag in session url updating (#13905)
2024-04-07 15:25:08 +02:00
Niels Dossche
4a14211739
Fix persistent local flag in session url updating (#13905)
Short-lived regression from 5ce9687cb2.
I forgot to add the persistent local flag, so that means that RC_DEBUG
will complain. These strings are local to the thread so we can just add
the flag to silence the debug checker in this case.
2024-04-07 15:24:29 +02:00
Niels Dossche
eb244fcb49
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [ci skip] NEWS
  Fix GH-13891: memleak and segfault when using ini_set with session.trans_sid_hosts (#13892)
2024-04-06 13:45:00 +02:00
Niels Dossche
5ce9687cb2
Fix GH-13891: memleak and segfault when using ini_set with session.trans_sid_hosts (#13892)
The hash tables used are allocated via the persistent allocator.
When using ini_set, the allocation happens via the non-persistent
allocator. When the table is then freed in GSHUTDOWN, we get a crash
because the allocators are mismatched.

As a side note, it is strange that this is designed this way, because it
means that ini_sets persist between requests...

Co-authored-by: Kamil Tekiela <tekiela246@gmail.com>
2024-04-06 13:43:26 +02:00
Niels Dossche
5daf080b6b
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [ci skip] NEWS
  Fix shift out of bounds on 32-bit non-fast-path platforms (#10941)
2024-04-04 19:29:29 +02:00