1
0
mirror of https://github.com/php/php-src.git synced 2026-03-29 11:42:17 +02:00
Commit Graph

64300 Commits

Author SHA1 Message Date
Niels Dossche
1a6f8a0b79 Fix some MariaDB test failures
Allow other wording too such that these mysqli tests pass.

Closes GH-17004.
2024-12-02 19:20:54 +01:00
David Carlier
73ebc92617 Fix GH-16959: snmpget modifies the object_id (as array).
Instead of modifying the zval, we use the zend_try_get_string.

close GH-16969
2024-12-01 13:57:31 +00:00
Christoph M. Becker
9bae8933a3 Fix GH-16991: Getting typeinfo of non DISPATCH variant segfaults
We must not assume that any `VARIANT` implements `IDispatch`.

Closes GH-16992.
2024-11-29 16:29:11 +01:00
Niels Dossche
e1b4534790 Fix GH-16905: Internal iterator functions can't handle UNDEF properties
Closes GH-16907.
2024-11-28 19:22:10 +01:00
David Carlier
7e8d6f941c Revert "ext/gmp: gmp_pow fix FPE with large values."
This reverts commit d70b7811b0.
2024-11-27 19:52:07 +00:00
David Carlier
45140e527f Revert "ext/gmp: gmp_pow fix FPE with large values."
This reverts commit e0a0e216a9.
2024-11-27 19:52:04 +00:00
Michael Orlitzky
ae84b81bfa Backport GH-14962 to stable versions
Alpine CI regularly fails because of the sorting order of these tests.
See https://github.com/php/php-src/pull/14962#issuecomment-2498799881

Closes GH-16950.
2024-11-26 21:24:48 +01:00
Niels Dossche
a80f0b515a Fix various memory leaks in curl mime handling
Closes GH-16745.
2024-11-26 20:37:22 +01:00
Derick Rethans
d1b9d7ee83 Fixed CS 2024-11-26 15:40:46 +00:00
Niels Dossche
de96b43d2a Fix GH-16902: Set of opcache tests fail zts+aarch64 (8.2-8.3)
Closes GH-16925.
2024-11-25 19:49:33 +01:00
Niels Dossche
99f5653ebb Fix GH-16908: _ZendTestMagicCallForward does not handle references well
This testing code was never meant to be used this way, but fixing this
will at least stop fuzzers from complaining about this, so might still
be worthwhile.

Closes GH-16919.
2024-11-25 19:38:33 +01:00
Christoph M. Becker
12ef3da381 Fix potential conflict of copy_variation5-win32.phpt
copy_variation1.phpt also creates and deletes a file copy.tmp in the
same folder, so conflicts may occur[1].  We apply a quick fix.

[1] <https://github.com/php/php-src/actions/runs/11902293714/job/33167012826>

Closes GH-16854.
2024-11-25 13:48:50 +01:00
Jakub Zelenka
173175badd Merge branch 'PHP-8.1' into PHP-8.2 2024-11-24 23:49:04 +01:00
Jakub Zelenka
eb951b3d11 Increase MySQLi fake server read timeout for ASAN job 2024-11-24 23:48:27 +01:00
Jakub Zelenka
06082671f4 Merge branch 'PHP-8.1' into PHP-8.2 2024-11-24 20:14:29 +01:00
Jakub Zelenka
51f5539914 Change port for mysqli fake server auth message test 2024-11-24 20:13:47 +01:00
Dylan K. Taylor
ff3b4eca0e Fix GH-16851: JIT_G(enabled) not set correctly on other threads
There doesn't seem to be a thread post-startup hook that runs after
zend_startup_cb() that could be used for this

this fix is similar to accel_startup_ok() as seen here: fc1db70f10/ext/opcache/ZendAccelerator.c (L2631-L2634)

Closes GH-16853.
2024-11-20 19:11:44 +01:00
Christoph M. Becker
3656a84c39 Skip file_put_contents_variation7.phpt on Windows
While the test obviously succeeds on Windows, it may occasionally
conflict with file_put_contents_variation7-win32.phpt[1], so we skip it
like we do for many other of these tests which have win32 pendants.

[1] <https://github.com/php/php-src/actions/runs/11527743659/job/32093951818>

Closes GH-16722.
2024-11-20 15:50:24 +01:00
Jakub Zelenka
c70b97d8eb Make MySQLnd protocol stmt test work on 32bit
Closes GH-16869.
2024-11-20 13:52:53 +01:00
Niels Dossche
f3ade203d7 Fix GHSA-r977-prxv-hc43
Move the bound check upwards. Since this doesn't generate output we can
check the bound first.
2024-11-20 11:07:04 +01:00
Jakub Zelenka
d37a20c4a2 Fix MySQLnd possible buffer over read in auth_protocol 2024-11-20 11:06:53 +01:00
Jakub Zelenka
a21e48a93a Make MySQLnd protocol stmt test work on 32bit 2024-11-20 11:06:43 +01:00
Jakub Zelenka
c595455300 Fix GHSA-h35g-vwh6-m678: Mysqlnd - various heap buffer over-reads
This fixes issues causing buffer over-read that leak heap content:
- RESP packet field default left over for COM_LIST
- RESP packet upsert filename
- OK packet message
- RESP packet for stmt row data
  - ps_fetch_from_1_to_8_bytes
  - ps_fetch_float
  - ps_fetch_double
  - ps_fetch_time
  - ps_fetch_date
  - ps_fetch_datetime
  - ps_fetch_string
  - ps_fetch_bit
- RESP packet for query row data (just possible overflow on 32bit)

It also adds various protocol tests using a new fake server.
2024-11-20 11:06:26 +01:00
Niels Dossche
fba659abb9 Fix GHSA-g665-fm4p-vhff: OOB access in ldap_escape 2024-11-20 11:06:12 +01:00
Jakub Zelenka
d7fe40868e Fix GHSA-c5f2-jwm7-mmq2: stream HTTP fulluri CRLF injection 2024-11-20 11:06:02 +01:00
Niels Dossche
7a25e7728d Fix GHSA-5hqh-c84r-qjcv: Integer overflow in the firebird quoter causing OOB writes 2024-11-20 11:05:55 +01:00
Niels Dossche
4a79a5a59a Fix GHSA-5hqh-c84r-qjcv: Integer overflow in the dblib quoter causing OOB writes 2024-11-20 11:05:48 +01:00
Dmitry Stogov
ef5844a1ca Use the immutable twin of temporary op_array (#16861) 2024-11-19 20:55:15 +03:00
Dmitry Stogov
6167c64782 Backport JIT fix: set valid EX(opline) before calling gc_possible_root() (#16858) 2024-11-19 18:03:54 +03:00
Jakub Zelenka
32f905f1d6 Fix MySQLnd possible buffer over read in auth_protocol 2024-11-18 16:55:44 +01:00
Dmitry Stogov
71403558d3 Fixed test 2024-11-18 15:34:55 +03:00
Dmitry Stogov
79aaeeafe5 Fix GH-16829: Segmentation fault with opcache.jit=tracing enabled on aarch64 2024-11-18 14:27:08 +03:00
Niels Dossche
81030c9bbb Fix GHSA-r977-prxv-hc43
Move the bound check upwards. Since this doesn't generate output we can
check the bound first.
2024-11-17 19:30:44 +01:00
Jakub Zelenka
2f5aa9f9d1 Fix GHSA-h35g-vwh6-m678: Mysqlnd - various heap buffer over-reads
This fixes issues causing buffer over-read that leak heap content:
- RESP packet field default left over for COM_LIST
- RESP packet upsert filename
- OK packet message
- RESP packet for stmt row data
  - ps_fetch_from_1_to_8_bytes
  - ps_fetch_float
  - ps_fetch_double
  - ps_fetch_time
  - ps_fetch_date
  - ps_fetch_datetime
  - ps_fetch_string
  - ps_fetch_bit
- RESP packet for query row data (just possible overflow on 32bit)

It also adds various protocol tests using a new fake server.
2024-11-17 19:30:13 +01:00
Niels Dossche
f9ecf90070 Fix GHSA-g665-fm4p-vhff: OOB access in ldap_escape 2024-11-17 19:29:56 +01:00
Jakub Zelenka
426a6d4539 Fix GHSA-c5f2-jwm7-mmq2: stream HTTP fulluri CRLF injection 2024-11-17 19:29:45 +01:00
Niels Dossche
69c5f68fdc Fix GHSA-5hqh-c84r-qjcv: Integer overflow in the firebird quoter causing OOB writes 2024-11-17 19:29:26 +01:00
Niels Dossche
d9baa9fed8 Fix GHSA-5hqh-c84r-qjcv: Integer overflow in the dblib quoter causing OOB writes 2024-11-17 19:29:16 +01:00
David Carlier
80894d87d5 Fix GH-16834: cal_from_jd overflow on julian_day argument.
close GH-16836
2024-11-17 12:27:02 +00:00
Niels Dossche
fbb0061993 Fix GH-16808: Segmentation fault in RecursiveIteratorIterator->current() with a xml element input
When the current data is invalid, NULL must be returned. At least that's
how the check in SPL works and how other extensions do this as well.
If we don't do this, an UNDEF value gets propagated to a return value
(misprinted as null); leading to issues.

Closes GH-16825.
2024-11-16 13:39:46 +01:00
Christoph M. Becker
f725f504e8 Adapt ext/intl tests for ICU 75.1 and 76.1
Closes GH-16788.
2024-11-15 18:55:01 +01:00
Christoph M. Becker
85e23dbbb2 Update FreeBSD CI
FreeBSD 13.2 is no longer supported[1], and apparently the respective
Cirrus CI image has been removed.  We update to FreeBSD 13.3.

This also requires to disable some compiler warnings now, and adapt a
test case.

[1] <https://www.freebsd.org/security/#sup>
[2] <https://github.com/php/php-src/runs/33044888209>

Co-authored-by: David Carlier <devnexen@gmail.com>

Closes GH-16817.
2024-11-15 18:20:48 +01:00
Niels Dossche
cbb3b9371d Fix GH-16770: Tracing JIT type mismatch when returning UNDEF
When returning an UNDEF value, it actually becomes NULL.
The following code took this into account:
28344e0445/ext/opcache/jit/zend_jit_trace.c (L2196-L2199)

But the stack does not update the type to NULL, causing a mismatch.

Closes GH-16784.

Co-authored-by: Dmitry Stogov <dmitry@zend.com>
2024-11-14 22:33:06 +01:00
David Carlier
4124b04e34 Fix GH-16771: imagecreatefromstring overflow on invalid format.
close GH-16776
2024-11-13 12:48:37 +00:00
Dmitry Stogov
19809a526b Fix incorrect handling of ZEND_ACC_FINAL flag in JIT (#16778) 2024-11-13 14:38:54 +03:00
Gina Peter Banyard
1b379f5e55 ext/hash: Fix GH-16711: Segfault in mhash()
Closes GH-16713
2024-11-10 20:15:44 +00:00
Gina Peter Banyard
fc8f30d312 ext/hash: Add failing tests for GH-16711 2024-11-10 20:14:21 +00:00
Niels Dossche
72c0222926 Fix GH-16695: phar:// tar parser and zero-length file header blocks
There are two issues:
1) There's an off-by-one in the check for the minimum file size for a
   tar (i.e. `>` instead of `>=`).
2) The loop in the tar parsing parses a header, and then unconditionally
   reads the next one. However, that doesn't necessarily exist.
   Instead, we remove the loop condition and check for the end of the
   file before reading the next header. Note that we can't use
   php_stream_eof as the flag may not be set yet when we're already at
   the end.

Closes GH-16700.
2024-11-09 17:07:53 +01:00
Niels Dossche
994e866cf2 Fix memory leak in php_openssl_pkey_from_zval()
Closes GH-16691.
2024-11-09 10:58:44 +01:00
Niels Dossche
2f4f09f7e6 Fix various memory leaks related to openssl exports
Closes GH-16692.
2024-11-09 10:58:17 +01:00