1
0
mirror of https://github.com/php/php-src.git synced 2026-04-19 14:01:01 +02:00
Commit Graph

123159 Commits

Author SHA1 Message Date
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
Tyson Andre
cd1c6f0b81 Fixes infinite recursion introduced by patch to SplFixedArray (#8105)
Closes GH-8079

Track whether the spl_fixedarray was modified since the last call to
get_properties
2022-02-23 19:23:00 -05:00
Ilija Tovilo
41461cf812 Migrate CI to GitHub actions 2022-02-23 14:32:50 +01:00
Christoph M. Becker
ef80dcb80b Fix GH-8074: Wrong type inference of range() result
If either the first or second operand of `range()` may be a string, we
must not exclude the possibility that the result may be an array of
longs.

Closes GH-8131.
2022-02-22 10:14:54 +01:00
Dmitry Stogov
3198b8787b JIT: Fix register allocation
Fixes oss-fuzz #44689
2022-02-18 17:15:07 +03:00
Dmitry Stogov
84a638a346 Fix memory leak
Fixes oss-fuzz #44685
2022-02-18 12:20:40 +03:00
Dmitry Stogov
8f5480e7eb Release lock and protect SHM before replaying warnings 2022-02-17 19:16:15 +03:00
Nikita Popov
bfe9531dc1 Initialize int_codepoint in parse_code_point_param()
This is being passed to convert_cp(), and passing an uninitialized
value to a function is undefined behavior. Clang 14 makes use of
noundef facts aggressively and miscompiles this code if not
initialized.
2022-02-16 19:01:44 +01:00
Christoph M. Becker
e98a7a68b7 Fix bugtracker URL
The php-src bugtracker is now on Github.

Closes GH-8102.
2022-02-15 19:14:07 +01:00
Derick Rethans
6fbf5a61bb Merge branch 'PHP-7.4' into PHP-8.0 2022-02-15 13:27:48 +00:00
Derick Rethans
325bcf9f1d Prepare for 7.4.29 2022-02-15 13:27:37 +00:00
Derick Rethans
f81059484d Merge branch 'PHP-7.4' into PHP-8.0 2022-02-14 16:24:44 +00:00
Derick Rethans
d13ceb74fa Add fix to NEWS 2022-02-14 16:23:06 +00:00
Kamil Tekiela
93a8d5cd17 Fix bug GH-8058 - mysqlnd segfault when prepare fails
Closes GH-8061
2022-02-14 11:45:17 +00:00
Stanislav Malyshev
61b276c873 Merge branch 'PHP-7.4' into PHP-8.0 2022-02-13 21:57:11 -08:00
Christoph M. Becker
82f1bf1b6b Fix #81708: UAF due to php_filter_float() failing for ints
We must only release the zval, if we actually assign a new zval.
2022-02-13 21:56:39 -08:00
Christoph M. Becker
dce5e561a6 Fix #81708: UAF due to php_filter_float() failing for ints
We must only release the zval, if we actually assign a new zval.
2022-02-13 21:31:35 -08:00
Dmitry Stogov
52ae6417ca Fixed GH-8044 (var_export/debug_zval_dump HT_ASSERT_RC1 debug failure for SplFixedArray) 2022-02-11 15:33:31 +03:00
Dmitry Stogov
912608d89b JIT: Fixed register clobbering during overflow handling
Fixes oss-fuzz #44535
2022-02-11 13:44:49 +03:00
Dmitry Stogov
7434909dc6 Fix type inference
Fixes oss-fuzz #44407
2022-02-11 13:03:36 +03:00
Dmitry Stogov
0d6b173532 JIT: Fix missed type store
Fizes oss-fuzz #44376
2022-02-11 12:05:57 +03:00
Dmitry Stogov
d0f965d078 Tracing JIT: Fixed incorrect deoptimization info 2022-02-11 11:10:22 +03:00
Dmitry Stogov
82bb169a08 Tracing JIT: Fixed incorrect deoptimization info
Fixes oss-fuzz #44294
2022-02-11 11:08:19 +03:00
Till Backhaus
29fe06fa59 Fix bug #76109: Implement fpm_scoreboard_copy
fpm_scoreboard_copy locks the scoreboard while copying the scoreboard and all
proc scoreboards. proc scoreboards are locked one by one while copying each
struct. The old implementation (inside fpm_handle_status_request) only briefly
locked the scoreboard while copying the scorebard.

Closes GH-7931

Co-authored-by: Jakub Zelenka <bukka@php.net>
2022-02-09 23:02:45 +00:00