1
0
mirror of https://github.com/php/php-src.git synced 2026-04-08 08:33:06 +02:00
Commit Graph

123145 Commits

Author SHA1 Message Date
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
Dmitry Stogov
c035298eb2 Free cached chunks when the requested memory limit is above real usage 2022-02-08 15:45:40 +03:00
Brett
1d48da6da5 Fixed libpng warning when loading interlaced images
We enable interlace transform when reading png.

Closes GH-8002.
2022-02-08 10:46:50 +01:00
Christoph M. Becker
86c196ba7f Fix GH-7980: Unexpected result for iconv_mime_decode
We need to reset the shift state right after conversion, to cater to
potenially following plain encodings.  Also, there is no need to reset
the shift for plain encodings, because these are not state-dependent.

Closes GH-8025.
2022-02-07 14:28:57 +01:00
David Carlier
bea542a953 Haiku fix ZTS build, disabling tls model
Closes GH-8047.
2022-02-07 13:05:54 +01:00
Christoph M. Becker
9bd468da63 Fix GH-7953: ob_clean() only does not set Content-Encoding
If an output handler has not yet been started, calling `ob_clean()`
causes it to start.  If that happens, we must not forget to set the
`Content-Encoding` and `Vary` headers.

Closes GH-7960.
2022-02-03 16:09:00 +01:00
Sara Golemon
8a46311dbd Bump for 8.0.17-dev 2022-02-02 23:44:02 +00:00
Dmitry Stogov
478448d271 JIT: Fix register alloction (missed store)
Fixes oss-fuzz #44242
2022-02-01 22:00:39 +03:00
Dmitry Stogov
a60a9b4a89 Fix memory leak
Fixes oss-fuzz #44222
2022-02-01 16:24:22 +03:00
Dmitry Stogov
54c952f11f JIT: Fix incorrect type store elimination
Fixes oss-fuzz #43737
2022-01-28 16:27:55 +03:00
Dmitry Stogov
f711c9603d Fix incorrect register allocation
Fixes oss-fuzz #44006
2022-01-28 13:08:11 +03:00
Dmitry Stogov
965dafe3e1 Fix too aggressive DCE that leads to memory leak
Fixes oss-fuzz #43738
2022-01-28 12:17:46 +03:00
Dmitry Stogov
464e725bb5 Fix typo (wrong string length)
Fixes oss-fuzz #44110
2022-01-28 11:04:51 +03:00
David Carlier
07aaa34cd4 Fix GH-7978: sockets extension compilation errors
We fix the `ucred` detection when custom `CFLAGS` are in use.

Closes GH-7981.
2022-01-21 23:56:56 +01:00
Kamil Tekiela
82b883034c Fix coding style from previous commit 2022-01-20 11:17:18 +00:00