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

66137 Commits

Author SHA1 Message Date
Remi Collet
a983a2554c relax test for zlib-ng 2025-02-11 22:38:41 +01:00
Ilija Tovilo
dc06a52362 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [skip ci] Another flaky macOS phar test
2025-01-28 12:58:55 +01:00
Ilija Tovilo
c14601cc90 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [skip ci] Another flaky macOS phar test
2025-01-28 12:58:42 +01:00
Ilija Tovilo
d9744869e6 [skip ci] Another flaky macOS phar test 2025-01-28 12:58:30 +01:00
Ilija Tovilo
2ad778bc76 Fix missing GC_PERSISTENT_LOCAL flag on accel_globals.key 2025-01-28 12:55:09 +01:00
Ilija Tovilo
b598dbf822 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [skip ci] Another flaky macOS phar test
2025-01-28 12:45:17 +01:00
Ilija Tovilo
01309961bb Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [skip ci] Another flaky macOS phar test
2025-01-28 12:45:10 +01:00
Ilija Tovilo
65b990a1e0 [skip ci] Another flaky macOS phar test 2025-01-28 12:44:24 +01:00
Ilija Tovilo
cee3687180 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix cve-2014-3538 test
2025-01-27 21:49:03 +01:00
Ilija Tovilo
7bda7ad31d Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix cve-2014-3538 test
2025-01-27 21:48:47 +01:00
Ilija Tovilo
d17d58a982 Fix cve-2014-3538 test
Make sure we have a unique test file to work with, and increase the time
for the nojit version to match the default version.

Closes GH-17600
2025-01-27 20:01:13 +01:00
Ilija Tovilo
8ea9b04a23 Fix inline zend_string using struct padding
As explained by Snape3058: On 64-bit machines, we typically have 7 bytes
of padding between the zend_string.val[0] char and the following char[].
This means that zend_string.val[1-7] write to and read from the struct
padding, which is a bad idea.

Allocate the given string separately instead.

Fixes GH-17564
Closes GH-17576
2025-01-27 19:50:38 +01:00
Calvin Buckley
556def741c Fix crash in PDO_ODBC statement dtor (#17586)
Port of 2ae897fff7 to PDO_ODBC.
2025-01-27 13:41:11 -04:00
Gina Peter Banyard
3027600ffc ext/pdo: Fix a UAF when changing default fetch class ctor args
Co-authored-by: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
2025-01-26 23:32:35 +00:00
Niels Dossche
2ae897fff7 Fix crash in firebird statement dtor
If both the driver object and statement end up in the GC buffer and are
freed by the GC, then the destruction order is not deterministic and it
is possible that the driver object is freed before the statement. In
that case, accessing S->H will cause a UAF. As the resources are already
released we simply skip the destruction if the driver object is already
destroyed.
2025-01-24 20:16:12 +00:00
Gina Peter Banyard
99f8ec33d9 ext/pdo: Fix memory leak if GC needs to free PDO Statement 2025-01-24 20:16:12 +00:00
Gina Peter Banyard
a85666c17b ext/session: Fix GH-17541 (ext/session NULL pointer dereferencement during ID reset)
Closes GH-17541
Closes GH-17546
2025-01-24 14:04:58 +00:00
Niels Dossche
2a2cc2ccce Fix type confusion with session SID constant
Closes GH-17548.
2025-01-23 19:03:04 +01:00
Niels Dossche
5344bcca97 Fix GH-17408: Assertion failure Zend/zend_exceptions.c
`zend_test_create_throwing_resource` sets the exception in the `test`
call frame and unwinds to `main`. It then throws for the `resource`
variable and verifies that the exception opline is set. However, it
wasn't set in `main`, it was set at the `test` call frame and rethrown later.
The assertion is too conservative, but the end result is right, so drop
the assertion.

Closes GH-17533.

Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>
2025-01-21 08:20:38 +01:00
Jakub Zelenka
191e16b703 Merge branch 'PHP-8.2' into PHP-8.3 2025-01-19 20:38:19 +01:00
Jakub Zelenka
5d632230ba Merge branch 'PHP-8.1' into PHP-8.2 2025-01-19 20:37:53 +01:00
Jakub Zelenka
235d1b14a3 Fix GH-17499: mysqli flaky test: ghsa-h35g-vwh6-m678-stmt-row-string 2025-01-19 20:36:12 +01:00
Niels Dossche
eab209d81d Fix GH-17518: offset overflow phar extractTo()
`search` can be the empty string, so we need to check the length before
checking the last char.

Closes GH-17519.
2025-01-19 13:05:19 +01:00
David Carlier
a1d1269688 Fix GH-17469: UConverter::transcode() not hardcoding error handling.
Respecting instead intl.use_exceptions/intl.error_level.

close GH-17488
2025-01-17 22:23:27 +00:00
Niels Dossche
82d71a82aa Fix GH-17500: Segfault with requesting nodeName on nameless doctype
Closes GH-17344.
2025-01-17 19:36:47 +01:00
Derick Rethans
7da1ea4029 Updated to version 2025.1 (2025a) 2025-01-17 11:53:10 +00:00
David Carlier
e4473abefc Fix GH-17463: SplTempFileObject::ftruncate() segfault on negative length.
close GH-465
2025-01-14 18:32:01 +00:00
Niels Dossche
d08a9e0010 Fix GH-17139: Fix zip_entry_name() crash on invalid entry
Don't increment the refcount, but latter remember the ID to check
afterwards whether the resource still exists.

Replaces GH-17142.
Closes GH-17439.
2025-01-12 20:37:51 +01:00
Niels Dossche
e8fce295bc Backport fix GH-17307
This is a backport of GH-17319 to fix GH-17307 on lower branches.

Closes GH-17424.
2025-01-10 18:24:25 +01:00
Niels Dossche
a2a7287b87 Fix GH-17409: Assertion failure Zend/zend_hash.c:1730
The array merging function may still hold the properties array while the
object is already being destroyed. Therefore, we should take into
account the refcount in simplexml's destruction code.
It may be possible to trigger this in other ways too.

Closes GH-17421.
2025-01-09 19:53:54 +01:00
Niels Dossche
783ecad82e Fix crashes in enchant when passing null bytes
See https://github.com/php/php-src/pull/17393#discussion_r1907660137

Closes GH-17407.
2025-01-08 20:47:01 +01:00
Christoph M. Becker
47683487f8 Fix libgd 223: gdImageRotateGeneric() does not properly interpolate
We port the respective upstream fix[1].  We only run the test against
bundled libgd, since external libgd may yield different results.

Cf. <2b26be874d>.

Closes GH-17380.
2025-01-06 20:37:23 +01:00
Christoph M. Becker
ec90367cd8 Fix GH-17373: imagefttext() ignores clipping rect for palette images
We apply the same fix that has been applied to external libgd at least
as of 2.0.29.

To avoid issues regarding minor FreeType rendering differences, the
test case does not compare against an image, but rather checks that all
pixels outside the clipping rect have the background color.

Closes GH-17374.
2025-01-06 14:57:46 +01:00
Jakub Zelenka
5b72f12c56 Rewrite http gh16810 test to not be online
Closes GH-17314
2025-01-06 12:20:13 +01:00
Jakub Zelenka
3606701f48 Merge branch 'PHP-8.2' into PHP-8.3 2025-01-06 12:19:36 +01:00
Jakub Zelenka
5be673d29e Merge branch 'PHP-8.1' into PHP-8.2 2025-01-06 12:18:54 +01:00
Jakub Zelenka
9e1b58274e Test stream_context_tcp_nodelay_server on Windows
Closes GH-17308
2025-01-05 14:44:22 +01:00
David Carlier
cd4481422b Fix GH-17330: SNMP::setSecurity segfaults when object had been closed.
checking when the workflow needs to deal with an existing SNMP session.

close GH-17337
2025-01-05 13:34:21 +00:00
Niels Dossche
ee2faaa423 Handle GC cycles properly in intl iterators
This is a follow-up on GH-17343 to implement GC cycle management.
Previously the objects lived too long due to the strong cycle.
This patch adds get_gc handlers to break the cycle.

Closes GH-17355.
2025-01-04 17:42:18 +01:00
Christoph M. Becker
2c658f422d Fix GH-17349: Tiled truecolor filling looses single color transparency
This is porting the relevant part of a previous upstream commit[1] to
align the behavior of our bundled libgd with upstream.  It should be
noted that this only works if the image actually has a transparent
color.

[1] <4770e2b2d5>

Closes GH-17351.
2025-01-04 14:53:18 +01:00
Niels Dossche
a970eefb6c Fix GH-11874: intl causing segfault in docker images
The segfault happens because zoi->wrapping_obj points to an object that has been freed.
This wrapping_obj is set in IntlIterator_from_StringEnumeration().
Notice how the refcount is not increased in this function.
By switching to ZVAL_OBJ_COPY, the segfault disappears.

We also need to move the responsibility of destroying the iterator to
the iterator itself and keep the object data destruction in the object
destruction. The existing code used a weird recursive destruction
between the iterator and object that was too hard to understand to be
honest. This patch simplifies everything and in the process gets rid of
the leak.

Iterators that are embedded are now responsible for their own
memory cleanup.

Closes GH-17343.
2025-01-03 18:58:15 +01:00
Niels Dossche
412a6b2e08 Fix GH-16800: ftp functions can abort with EINTR
This adds wrappers around recv(), send(), and php_pollfd_for_ms() to
handle EINTR.

This is a bit hard to test on its own, but it is testable manually using
the following script:
```php
pcntl_signal(SIGUSR1, function() {
    var_dump(func_get_args());
}, false);

var_dump(getmypid());
sleep(10);

$ftp = ftp_connect('127.0.0.1');
ftp_login($ftp, 'user', 'pass');
ftp_put($ftp, 'testfile', 'testfile');
```

in combination with an infinite while loop that sends SIGUSR1 to the
process.

Closes GH-17327.
2025-01-03 12:30:43 +01:00
Christoph M. Becker
9999a5b4de Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  gh15937.phpt does not need to be an online test
2025-01-01 20:07:34 +01:00
Christoph M. Becker
919f1984d5 gh15937.phpt does not need to be an online test
We convert the test to use the CLI test server to not require online
availability.

As of PHP 8.3, the test is supposed to fail, because the timeout is too
large.  Since exactly this scenario is already tested by gh16810.phpt,
we drop the test for PHP-8.3 and up.

Closes GH-17315.
2025-01-01 20:06:23 +01:00
Jakub Zelenka
19e2e4d5af Port stream bug51056 and gh11418 tests to use ephemeral ports 2024-12-31 15:18:50 +01:00
Jakub Zelenka
e0dabe326f Merge branch 'PHP-8.2' into PHP-8.3 2024-12-31 15:05:18 +01:00
Jakub Zelenka
37504f123d Port OpenSSL gh10495, gh13860 and gh9310 test to use ephemeral ports 2024-12-31 15:02:08 +01:00
Jakub Zelenka
44a9154e75 Merge branch 'PHP-8.1' into PHP-8.2 2024-12-31 14:39:59 +01:00
Jakub Zelenka
b8731767d8 Fix GH-16955: Use empheral ports for OpenSSL server client tests
And refactor some client server tests.

Closes GH-17180
2024-12-31 14:25:19 +01:00
Calvin Buckley
7c9f645393 Fix FD getting code on big endian (#17259)
* Fix FD getting code on big endian (PHP 8.3)

stream casting as FD returns a php_socket_t, which is an int, but
zend_long is 64-bit (on those platforms). This works on LE by
accidental (unless it forgets to clear the high word), but is fatal
on big endian.

* change cast to match sig
2024-12-30 12:40:32 -04:00