1
0
mirror of https://github.com/php/php-src.git synced 2026-04-07 16:13:32 +02:00
Commit Graph

123182 Commits

Author SHA1 Message Date
Dmitry Stogov
5b048dd05c Tracing JIT: Fixed incorrect assumption about stack slot type
Fixes oss-fuzz #46404
2022-04-11 11:42:01 +03:00
Ilija Tovilo
9af3759987 Remove issue_comment trigger on nightly
This was a left-over from the attept to trigger nightly via comment.
2022-04-10 01:10:25 +02:00
Ilija Tovilo
5de1cd9e48 Add nightly for GitHub actions 2022-04-09 17:08:18 +02:00
Christoph M. Becker
7c702b72f2 Fix GH-8267: MySQLi uses unsupported format specifier on Windows
Instead of using the unsupported `%I64u` and `%I64d` format specifiers
on Windows, we use the portable `PRIu64` and `PRId64` specifiers.

The `L64()` macro and the `my_longlong` typedef should be adapted as
well, as the `i64` literal suffix is still supported by MSVC, but using
`LL` or `ll` is recommended[1], and the standard `int64_t` is available
there anyway.  This is not urgent, though.

[1] <https://docs.microsoft.com/en-us/cpp/cpp/numeric-boolean-and-pointer-literals-cpp?view=msvc-170#integer-literals>

Closes GH-8268.
2022-04-07 17:03:15 +02:00
Derick Rethans
7aefee1613 Updated to version 2022.1 (2022a) 2022-04-07 10:45:19 +01:00
Derick Rethans
9efaf3c54b Empty merge 2022-04-07 10:45:19 +01:00
Derick Rethans
341bea37e8 Updated to version 2022.1 (2022a) 2022-04-07 10:45:17 +01:00
Christoph M. Becker
c2eafc29f5 Fix #81714: segfault when serializing finalized HashContext
We must not allow to serialize already finalized `HashContext`s, since
the internal context is already freed.  Since there is not much point
in serializing finalized `HashContext`s, we just bail out in that case.

Closes GH-8265.
2022-04-05 13:25:22 +02:00
Christoph M. Becker
43f3745abb Bump version
Apparently, this has been forgotten when PHP 8.0.17RC1 and 8.0.18RC1
had been tagged.

We also fix the version of the fix for GH-8253, which didn't make it
into PHP 8.0.18RC1.
2022-04-05 13:19:02 +02:00
Dmitry Stogov
c489e360a6 JIT: Fix array clobbering by user error handler
Fixes oss-fuzz #46336
2022-04-04 16:36:25 +03:00
Dmitry Stogov
c0bb238483 Fixed reference counting inference
Fixes oss-fuzz #46084
2022-04-04 15:34:02 +03:00
Bob Weinand
9cb512ecc1 Ensure correct target opline for exceptions thrown during yield from
Also appends the exception during a yield from values dtor instead of prepending it

Fixing regression introduced in 13649451c2.
2022-04-04 14:24:39 +02:00
Dmitry Stogov
0d44bbd212 JIT: Fixed incorrect code generation
Fixes oss-fuzz #46328
2022-04-04 14:20:45 +03:00
Bob Weinand
13649451c2 Fix GH-8289: Exceptions thrown within a yielded from iterator are not rethrown into the generator
This also fixes the fact that exception traces were not including the generator frame when thrown in a yielded from iterator.
2022-04-01 17:32:48 +02:00
Ilija Tovilo
d82d62c237 Re-enable i386 tests on Azure Pipelines 2022-04-01 12:55:31 +02:00
Kamil Tekiela
06e383b2f4 Fix regression from #8058
Closes GH-8181
2022-03-31 10:31:52 +01:00
Christoph M. Becker
0e6d6f83cc Fix GH-8253: pg_insert() fails for references
We need to deref the values.

Closes GH-8262.
2022-03-29 10:51:19 +02:00
Remi Collet
fe4aba6588 typo 2022-03-29 10:20:21 +02:00
Remi Collet
23cce68d24 run-tests.php: fix TypeError: Unsupported operand types: string * int <n> is mandatory for --show-slow and --set-timeout use <n> in help message instead of confusing [n] 2022-03-29 09:54:40 +02:00
Stanislav Malyshev
2119ba215a Don't try to access memory outside string 2022-03-28 10:52:34 -06:00
Christoph M. Becker
5a8622fe78 Fix result_type related stack corruption on LLP64 architectures
Integer parameters are stored in `zend_long` values, which have 64 bits
on LLP64, but `long` has only 32 bits there.

Adding a test might be overkill, because the broken behavior could
already be observed when running pg_select_001.phpt on Windows debug
builds, which report the stack corruption.

Closes GH-8263.
2022-03-28 18:27:44 +02:00
Christoph M. Becker
771dbdb319 Fix signedness confusion in php_filter_validate_domain()
As is, there is the possibility that integer underflow occurs, making
`_php_filter_validate_domain()` succeed for very long domain names.

Cf. <https://pwning.systems/posts/php_filter_var_shenanigans/>.
2022-03-28 14:00:22 +02:00
Dmitry Stogov
aa352c2c54 JIT: Fixed memory leak
Fixes oss-fuzz #45981
2022-03-25 16:54:50 +03:00
Dmitry Stogov
cf83bdd925 JIT: Fix register clobbering
Fixes oss-fuzz #45590
2022-03-21 16:08:52 +03:00
Dmitry Stogov
e9fc81a2f8 JIT: Fix missing type store
Fixes oss-fuzz #45604
2022-03-21 13:34:46 +03:00
Dmitry Stogov
7051dc3372 JIT: Fix memory leak
Fixes oss-fuzz #45658
2022-03-21 12:50:30 +03:00
Dmitry Stogov
3d6a7e2bd5 JIT: Fix missing exception handling
Fixes oss-fuzz #45649
2022-03-18 18:54:47 +03:00
Christoph M. Becker
d0417ebc93 Fix GH-8208: mb_encode_mimeheader: $indent functionality broken
We also need to factor in the indent, when getting the encoder result.

Closes GH-8213.
2022-03-17 17:31:58 +01:00
Christoph M. Becker
ef29ddcc27 Fix GH-8068: mysqli_fetch_object creates inaccessible properties
When fetching into objects, we need to create object style hash tables,
i.e. where numeric column names are stored as string keys instead of
integer keys.  Instead of the slightly more efficient alternative to
create the desired hash table in the first place, we go for the more
readable implementation and convert the array style hash table using
`zend_symtable_to_proptable()`.

Co-authored-by: Kamil Tekiela <tekiela246@gmail.com>

Closes GH-8189.
2022-03-14 14:27:04 +01:00
Dmitry Stogov
2b7431cf5b Fix memory leak
Fixed oss-fuzz #45535
2022-03-14 12:57:37 +03:00
Dmitry Stogov
e20f955e44 JIT: Fix register allocation
Fixes oss-fuzz #45487
2022-03-14 11:46:45 +03:00
Dmitry Stogov
9792f0db76 JIT: Fix type store
Fixes oss-fuzz #45190
2022-03-14 09:48:58 +03:00
Michael Voříšek
2b2aeb989e Fix GH-8160: ZTS support on Alpine is broken
We need to export `__MUSL__` so that phpize builds can see the proper
macro, and also need to fix "_tsrm_ls_cache" usage for musl.

Closes GH-8180.
2022-03-11 14:39:39 +01:00
Dmitry Stogov
6c3816cee5 Tracing JIT: Eliminate useless guards for CONCAT
Fixes oss-fuzz #45285
2022-03-11 12:39:10 +03:00
Dmitry Stogov
151d2ac5ae Fixed memory leak
Fixes oss-fuzz #45191
2022-03-11 11:32:23 +03:00
David Carlier
7eb972c456 Fix Solaris builds of ext/sockets
We enable the proper ancillary data handling layout and API.

Closes GH-7859.
2022-03-10 14:48:08 +01:00
Christoph M. Becker
1d9a1f9be3 Fix GH-8121: SplFileObject - seek and key with csv file inconsistent
First, we must not free the current line before we call
`spl_filesystem_file_read_csv()`, because then the `current_line` will
not be properly updated.  Since the EOF check is superfluous here, we
move that part of the code to the branch for subtypes.  This issue has
been introduced by the fix for bug 75917.

Second, we only must increase the `current_line` if we're not reading
ahead.  This issue has been introduced by the fix for bug 62004.

Closes GH-8138.
2022-03-08 16:54:02 +01:00
Bob Weinand
15949b61ba Fix ZTS build after cherry-pick 2022-03-07 22:24:55 +01:00
Tim Düsterhus
0d7e10c1a9 Fix memory leak of function attribute hash table (#8070)
==109253== 280 (56 direct, 224 indirect) bytes in 1 blocks are definitely lost in loss record 4 of 4
    ==109253==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
    ==109253==    by 0x6D9FA2: __zend_malloc (zend_alloc.c:3068)
    ==109253==    by 0x745138: zend_add_attribute (zend_attributes.c:226)
    ==109253==    by 0x6680D1: zend_add_parameter_attribute (zend_attributes.h:102)
    ==109253==    by 0x66B787: zm_startup_zend_test (test.c:478)
    ==109253==    by 0x7224CD: zend_startup_module_ex (zend_API.c:2202)
    ==109253==    by 0x72252C: zend_startup_module_zval (zend_API.c:2217)
    ==109253==    by 0x734288: zend_hash_apply (zend_hash.c:2011)
    ==109253==    by 0x722C30: zend_startup_modules (zend_API.c:2328)
    ==109253==    by 0x67409B: php_module_startup (main.c:2256)
    ==109253==    by 0x88EDDE: php_cli_startup (php_cli.c:409)
    ==109253==    by 0x890F61: main (php_cli.c:1334)
2022-03-07 22:05:40 +01:00
Bob Weinand
f095d2c91b Fix freeing of internal attribute arguments 2022-03-07 22:04:16 +01:00
David Carlier
8b15858c58 Fix GH-8142: Compilation error on cygwin
* pcntl: SIGPOLL/si_band is unsupported
* intl: enable the signal apis with `_POSIX_C_SOURCE`

Closes GH-8146.
2022-03-04 16:20:39 +01:00
risner
57ef16bb5d Fix GH-8048: disk_*_space wrong for some filesystems on macOS
A macOS bug in libc statvfs(3) call truncates 64 bit elements (e.g.
f_blocks) to 32 bits.  Thus, we force macOS to use statfs.

Closes GH-8056.
2022-03-04 16:06:35 +01:00
Bob Weinand
e6cf583160 Fix GH-8082: Prevent leaking memory on observed transient run_time_caches
This is achieved by tracking the observers on the run_time_cache (with a fixed amount of slots, 2 for each observer).
That way round, if the run_time_cache is freed all associated observer data is as well.

This approach has been chosen, as to avoid any ABI or API breakage.
Future versions may for example choose to provide a hookable API for run_time_cache freeing or similar.
2022-03-01 14:49:44 +01:00
Gabriel Caruso
05f2fb3af3 Fix NEWS format 2022-03-01 11:32:28 +01:00
Gabriel Caruso
5507201a38 Prepare for PHP 8.0.18 2022-03-01 11:30:01 +01:00
Dmitry Stogov
01702a851b Fix use after free
Fixes oss-fuzz #44885
2022-03-01 01:33:22 +03:00
Dmitry Stogov
70f7e7d83f JIT: Fix memory leak
Fixes oss-fuzz #44920
2022-02-28 15:43:03 +03:00
Dmitry Stogov
ac8a53cab1 JIT: Fix register allocator
Fixes oss-fuzz #44916
2022-02-28 13:48:53 +03:00
Christoph M. Becker
0d266a24d6 Fix GH-8080: ReflectionClass::getConstants() depends on def. order
When we need to evaluate constant ASTs, we always have to do that in
the scope where the constant has been defined, which may be a parent
of the `ReflectionClass`'s scope.

Closes GH-8106.
2022-02-28 10:08:47 +01:00
Dmitry Stogov
78c7289f69 Fixed incorrect DCE for FREE
Fixes oss-fuzz #44863
2022-02-28 11:44:22 +03:00