Commit graph

130507 commits

Author SHA1 Message Date
Remi Collet
494d9e1f31
avoid test file being consider binary
(cherry picked from commit f575027b56)
2023-03-14 18:00:53 +03:00
Derick Rethans
a35639db51
Fixed test for GH-10147
(cherry picked from commit 2d3aa8a5c4)
2023-03-14 18:00:46 +03:00
Ilija Tovilo
c52d1f5e9e
[skip ci] Mark failing date test as xfail
(cherry picked from commit cc902530f2)
2023-03-14 18:00:36 +03:00
Niels Dossche
ca1b7312d2
Fix module shutdown crash during ZTS JIT shutdown
Commit a21195650e fixed a leak by adding a TSRM destructor for the
JIT globals in ZTS mode. In case the main thread shuts down the TSRM, it
will call all the destructors. The JIT globals destructor will be
invoked, but will always access the main thread globals using JIT_G.
This means that instead of freeing the JIT globals in the different
threads, the one in the main thread is freed repeatedly over and over,
crashing PHP. Fix it by always passing the pointer instead of relying on
JIT_G.

Closes GH-10835.

(cherry picked from commit b3e28e2290)
2023-03-13 23:26:06 +03:00
Derick Rethans
31f388c353
Fix GH-10747: Private and protected properties in serialized Date* objects throw 2023-03-10 10:44:16 -05:00
Dmitry Stogov
5eb7d7e07b
Fix Zend/tests/type_declarations/variance/class_order_autoload1.phpt
test failre introduced by 44e5c04e55

This ASSERT-ion path was never reached becuase of the bug fixed by
44e5c04e55. It's possible in case of
circular class dependencies that may resolved by __autoload().
Unfortunately these circular dependencies can't be stored in the
inheritace cahce.

(cherry picked from commit 18b43d2950)
2023-03-02 02:05:43 +03:00
David Carlier
4c2db35b05 Merge branch 'PHP-8.1' into PHP-8.2 2023-02-27 19:48:13 +00:00
Niels Dossche
0f21cbc57c Fix GH-10715: phpdbg heap buffer overflow -- by misuse of the option "--run"
Fixes GH-10715

When a string starting with a NUL character is passed to
phpdbg_vprint(), the vasprintf() will return that 0 characters have been
printed. This causes msglen == 0. When phpdbg_process_print() is called
with a message of length 0, the -1 to check for '\n' will perform an out
of bounds read. Since nothing is printed anyway for msglen == 0, it
seems best to just skip the printing routine for this case.

Closes GH-10720.
2023-02-27 19:47:55 +00:00
Dmitry Stogov
db7358ccc9 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix incorrect inheritance cache update (#10719)
2023-02-27 21:47:46 +03:00
Dmitry Stogov
44e5c04e55 Fix incorrect inheritance cache update (#10719) 2023-02-27 21:47:29 +03:00
Dmitry Stogov
2e3fc8c0ff
Fix incorrect inheritance cache update (#10719) 2023-02-27 21:39:18 +03:00
George Peter Banyard
f440911057
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fixed ValueError message in count_chars()
  Fixed ValueError message in substr_compare()
  The userland constants do not start with PHP_
2023-02-26 14:28:22 +00:00
George Peter Banyard
adc5edd411
Fixed ValueError message in count_chars()
The value of the mode argument must be between 0 and 4 inclusive, not 1 and 4.
2023-02-26 14:27:46 +00:00
George Peter Banyard
2133970152
Fixed ValueError message in substr_compare()
It used some random argument name instead of
2023-02-26 14:25:02 +00:00
George Peter Banyard
6a5b3f0ff9
The userland constants do not start with PHP_ 2023-02-26 14:18:12 +00:00
David Carlier
bf2e778c71 Merge branch 'PHP-8.1' into PHP-8.2 2023-02-26 08:18:09 +00:00
Niels Dossche
b09be29ac1 Fix incorrect error checking in php_openssl_set_server_dh_param()
SSL_CTX_set_tmp_dh() and SSL_CTX_set0_tmp_dh_pkey() return 1 on success
and 0 on error. But only < 0 was checked which means that errors were
never caught.

Closes GH-10705.
2023-02-26 08:17:14 +00:00
Niels Dossche
eb7bb3430b Fix format string mistake in accel_move_code_to_huge_pages()
inode is unsigned, so use %lu instead of %ld
2023-02-26 08:12:57 +00:00
David Carlier
7638640529 Fix GH-10659: hash/xxhash applying build upstream fix
ref: 6189ecd3d4

replacing the C++ compile time assert for C11 one.

Closes GH-10693.
2023-02-25 14:36:35 +00:00
David Carlier
bf68d10bb4 Merge branch 'PHP-8.1' into PHP-8.2 2023-02-25 14:33:11 +00:00
Niels Dossche
df579adac7 Fix GH-10692: PHP crashes on Windows when an inexistent filename is executed
Fixes GH-10692

php_fopen_primary_script() does not initialize all fields of
zend_file_handle. So when it fails and when fastcgi is true, the
zend_destroy_file_handle() function will try to free uninitialized
pointers, causing a segmentation fault. Fix it by zero-initializing file
handles just like the zend_stream_init_fp() counterpart does.

Closes GH-10697.
2023-02-25 14:32:55 +00:00
Ilija Tovilo
c9bd540bac
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [skip ci] Add github reference to bug fix in NEWS
2023-02-24 20:45:31 +01:00
Ilija Tovilo
7d2b01eea7
[skip ci] Add github reference to bug fix in NEWS 2023-02-24 20:44:47 +01:00
Ilija Tovilo
9b10b65e2b
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-10570: Assertion `(key)->h != 0 && "Hash must be known"' failed.
2023-02-24 20:41:40 +01:00
Niels Dossche
b9a5bfc355
Fix GH-10570: Assertion `(key)->h != 0 && "Hash must be known"' failed.
Fixes GH-10570, see GH-10570 for analysis.

Closes GH-10572
2023-02-24 20:40:29 +01:00
David Carlier
9cac68d678 Merge branch 'PHP-8.1' into PHP-8.2 2023-02-24 17:03:00 +00:00
nielsdos
8959ff39d8 Fix incorrect type for return value of zend_update_static_property_ex()
zend_update_static_property_ex() returns a zend_result, but the return
value is stored here in a bool. A bool is unsigned on my system, so in
case zend_update_static_property_ex() returns FAILURE (== -1) this gets
converted to 1 instead. This is not a valid zend_result value. This
means that (transitive) callers could mistakingly think the function
succeeded while it did in fact not succeed. Fix it by changing the type
to zend_result.

Closes GH-10691.
2023-02-24 17:02:32 +00:00
George Peter Banyard
512abc23a4
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fixed bug GH-10270 Unable to return CURL_READFUNC_PAUSE in readfunc callback
  Fix GH-10672 (pg_lo_open segfaults in the strict_types mode)
2023-02-24 14:33:28 +00:00
Pierrick Charron
91db3a1b85
Fixed bug GH-10270 Unable to return CURL_READFUNC_PAUSE in readfunc callback
Closes GH-10607

Signed-off-by: George Peter Banyard <girgias@php.net>
2023-02-24 14:32:23 +00:00
George Peter Banyard
5f357f341d
Fix GH-10672 (pg_lo_open segfaults in the strict_types mode)
We need to use the proper ZPP qualifier for zend_string

Closes GH-10677
2023-02-24 14:31:23 +00:00
Ilija Tovilo
f1818d726f
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix segfault when using ReflectionFiber (fixes #10439)
2023-02-23 23:27:55 +01:00
Daniil Gentili
8d1c0a1403
Fix segfault when using ReflectionFiber (fixes #10439)
Closes GH-10478
2023-02-23 23:20:27 +01:00
Ilija Tovilo
c891495e04
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Re-enable UnixODBC testing.
2023-02-23 23:14:34 +01:00
Danack
939c546ea1
Re-enable UnixODBC testing.
The problem installing the package in the CI environment has been fixed.
2023-02-23 23:14:02 +01:00
David Carlier
bb2177e248 Merge branch 'PHP-8.1' into PHP-8.2 2023-02-23 18:48:25 +00:00
Niels Dossche
c510083c8c Fix incorrect string length for output_handler in zlib ini code
The length of "output_handler" is supposed to be passed, but as sizeof
is used, the resulting number includes the NUL character, so the length
is off-by-one. Subtract one to pass the correct length.

Closes GH-10667.
2023-02-23 18:47:26 +00:00
SATO Kentaro
7fccdf72a4
Add support for generating namespaced constant
Closes GH-10552
2023-02-23 10:05:30 +01:00
Tim Düsterhus
9660a7fa59
makedist: Use fixed sort in generated tarball (#10615)
Instead of some undefined order, the files will now be includes in alphabetical
order to make the tarball more reproducible.
2023-02-22 20:14:54 +01:00
David Carlier
8c87a5cc6f Merge branch 'PHP-8.1' into PHP-8.2 2023-02-21 21:24:57 +00:00
Kévin Dunglas
c4c861b01a make clean: remove ext/opcache/minilua
Closes GH-10656.
2023-02-21 21:24:16 +00:00
David Carlier
bb16c2e90f Merge branch 'PHP-8.1' into PHP-8.2 2023-02-21 21:03:28 +00:00
NathanFreeman
0a466e7ad8 Fix GH-10647: Spoofchecker isSuspicious/areConfusable methods
error code's argument.

Closes GH-10653.
2023-02-21 21:00:49 +00:00
David Carlier
9995514718 Merge branch 'PHP-8.1' into PHP-8.2 2023-02-21 16:10:32 +00:00
nielsdos
da3ce6015d Propagate errors correctly in ps_files_cleanup_dir()
In SessionHandler::gc, we use a virtual call to PS(default_mod)->s_gc to
call the gc implementation. That return value is checked against
FAILURE (-1).
One of the call targets of PS(default_mod)->s_gc is ps_gc_files().
ps_gc_files() calls to ps_files_cleanup_dir(). The latter function has
some error checks and outputs a notice if something goes wrong. In cases
of errors, the function returns 0. This means that the check in
SessionHandler::gc will misinterpret this as a success and report that 0
files have been *successfully* cleaned up. Fix it by returning -1 to
indicate something *did* go wrong.

Closes GH-10644.
2023-02-21 16:09:22 +00:00
George Peter Banyard
054d83b292
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix Tidy tests failing due to different spelling
2023-02-21 14:32:52 +00:00
nielsdos
74c880edd1
Fix Tidy tests failing due to different spelling
On my system, with Tidy 5.7.45, I get the following error diff for two
tests:
002+ line 1 column 7 - Error: <asd> is not recognised!
002- line 1 column 7 - Error: <asd> is not recognized!

As we can see, the spelling of recognised is different. Use an EXPECTF
and %c to mitigate this issue.

Signed-off-by: George Peter Banyard <girgias@php.net>
2023-02-21 14:32:39 +00:00
George Peter Banyard
16bdb9b522
[skip ci] Update NEWS with bugfixes backported from 8.1 2023-02-21 14:29:02 +00:00
George Peter Banyard
0f394ecbe8
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix incorrect error check in browsecap for pcre2_match()
  Add missing error check on tidyLoadConfig
2023-02-21 14:13:35 +00:00
ndossche
8cac8306c3
Fix incorrect error check in browsecap for pcre2_match()
pcre2_match() returns error codes < 0, but only the "no match" error
code was handled. Fix it by changing the check to >= 0.

Closes GH-10632

Signed-off-by: George Peter Banyard <girgias@php.net>
2023-02-21 14:13:13 +00:00
ndossche
f592f75e9c
Add missing error check on tidyLoadConfig
Parse errors were not reported for the default config, they were only
reported when explicitly another config was loaded.
This means that users may not be aware of errors in their configuration
and therefore the behaviour of Tidy might not be what they intended.
This patch fixes that issue by using a common function. In fact, the
check for -1 might be enough for the current implementation of Tidy, but
the Tidy docs say that any value other than 0 indicates an error.
So future errors might not be caught when just using an error code of -1.
Therefore, this also changes the error code checks of == -1 to < 0 and
== 1 to > 0.

Closes GH-10636

Signed-off-by: George Peter Banyard <girgias@php.net>
2023-02-21 14:12:17 +00:00