Commit graph

63038 commits

Author SHA1 Message Date
George Peter Banyard
31fd34aa4c
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Use absolute paths in OPCache tests when calling `opcache_compile_file()`
2023-01-12 15:48:01 +00:00
Thomas Gerbet
1f715f5658
Use absolute paths in OPCache tests when calling opcache_compile_file()
This make sure the tests do not fail if they are not run from the
repository root.

Closes GH-10266

Signed-off-by: George Peter Banyard <girgias@php.net>
2023-01-12 15:47:24 +00:00
Derick Rethans
f340854a30 Merge branch 'PHP-8.1' into PHP-8.2 2023-01-10 15:16:32 +00:00
Derick Rethans
d12ba111e0 Fixed GH-10218: DateTimeZone fails to parse time zones that contain the "+" character 2023-01-10 15:15:49 +00:00
Christoph M. Becker
435dc5ef1c
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Adapt ext/intl tests for ICU 72.1
2023-01-09 14:09:43 +01:00
Christoph M. Becker
a9e7b90cc2
Adapt ext/intl tests for ICU 72.1
This version replaces SPACEs before the meridian with NARROW NO-BREAK
SPACEs.  Thus, we split the affected test cases as usual.

(cherry picked from commit 8dd51b462d)

Fixes GH-10262.
2023-01-09 14:08:40 +01:00
Dmitry Stogov
9abc2108fa Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix incorrect optimization of ASSIGN_OP may lead to incorrect result (sub assign -> pre dec conversion for null values)
2023-01-09 13:53:19 +03:00
Dmitry Stogov
4d4a53beee Fix incorrect optimization of ASSIGN_OP may lead to incorrect result (sub assign -> pre dec conversion for null values) 2023-01-09 13:51:57 +03:00
Dmitry Stogov
d13b3b6aa7 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  ext/opcache/jit/zend_jit_trace: fix memory leak in _compile_root_trace() (#10146)
2023-01-09 09:51:00 +03:00
Max Kellermann
bcc5d268f6
ext/opcache/jit/zend_jit_trace: fix memory leak in _compile_root_trace() (#10146)
A copy of this piece of code exists in zend_jit_compile_side_trace(),
but there, the leak bug does not exist.

This bug exists since both copies of this piece of code were added in
commit 4bf2d09ede
2023-01-09 09:50:30 +03:00
Tim Düsterhus
32f503e4e3
random: Fix check before closing random_fd (#10247)
If, for whatever reason, the random_fd has been assigned file descriptor `0` it
previously failed to close during module shutdown, thus leaking the descriptor.
2023-01-07 14:03:13 +01:00
Niels Dossche
df96346f9c Move test for GH-10200 to the simplexml extension test directory
Closes GH-10252

Signed-off-by: George Peter Banyard <girgias@php.net>
2023-01-07 03:07:37 +00:00
Alex Dowad
1751f34cfa Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Use different mblen_table for different SJIS variants
  Correct entry for 0x80,0xFD-FF in SJIS multi-byte character length table
2023-01-06 14:13:21 +02:00
Alex Dowad
3152b7b26f Use different mblen_table for different SJIS variants 2023-01-06 14:09:43 +02:00
Alex Dowad
d104481af8 Correct entry for 0x80,0xFD-FF in SJIS multi-byte character length table
As a performance optimization, mbstring implements some functions using
tables which give the (byte) length of a multi-byte character using a
lookup based on the value of the first byte. These tables are called
`mblen_table`.

For many years, the mblen_table for SJIS has had '2' in position 0x80.
That is wrong; it should have been '1'. Reasons:

For SJIS, SJIS-2004, and mobile variants of SJIS, 0x80 has never been
treated as the first byte of a 2-byte character. It has always been
treated as a single erroneous byte. On the other hand, 0x80 is a valid
character in MacJapanese... but a 1-byte character, not a 2-byte one.

The same applies to bytes 0xFD-FF; these are 1-byte characters in
MacJapanese, and in other SJIS variants, they are not valid (as the
first byte of a character).

Thanks to the GitHub user 'youkidearitai' for finding this problem.
2023-01-05 14:05:39 +02:00
David Carlier
acb1af802d Merge branch 'PHP-8.1' into PHP-8.2 2023-01-02 16:55:03 +00:00
Niels Dossche
d5f0362e59 Fix GH-10202: posix_getgr(gid|nam)_basic.phpt fail
The issue was that passwd was empty for the issue reporter, but the test
expected passwd to be non-empty. An empty passwd can occur if there is
no (encrypted) group password set up.
2023-01-02 16:54:47 +00:00
George Peter Banyard
e6c9b176d4 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-10187: Segfault in stripslashes() with arm64
  Fix memory leak in posix_ttyname()
2022-12-30 16:42:45 +00:00
Niels Dossche
4c9375e504 Fix GH-10187: Segfault in stripslashes() with arm64
Closes GH-10188

Co-authored-by: todeveni <toni.viemero@iki.fi>
Signed-off-by: George Peter Banyard <girgias@php.net>
2022-12-30 16:40:56 +00:00
George Peter Banyard
c2b0be5570 Fix memory leak in posix_ttyname()
Closes GH-10190
2022-12-30 16:24:28 +00:00
Alex Dowad
f7a19181d7 Allow 'h' and 'k' flags to be combined for mb_convert_kana
The 'h' flag makes mb_convert_kana convert zenkaku hiragana to hankaku
katakana; 'k' makes it convert zenkaku katakana to hankaku katakana.

When working on the implementation of mb_convert_kana, I added some
additional checks to catch combinations of flags which do not make
sense; but there is no conflict between 'h' and 'k' (they control
conversions for two disjoint ranges of codepoints) and this combination
should not have been restricted.

Thanks to the GitHub user 'akira345' for reporting this problem.

Closes GH-10174.
2022-12-29 20:38:01 +02:00
David Carlier
07bf42df41 Merge branch 'PHP-8.1' into PHP-8.2 2022-12-29 12:21:13 +00:00
Max Kellermann
e217138b40 ext/opcache/jit/zend_jit_trace: add missing lock for EXIT_INVALIDATE
Commit 6c25413183 added the flag ZEND_JIT_EXIT_INVALIDATE which
resets the trace handlers in zend_jit_trace_exit(), but forgot to
lock the shared memory section.

This could cause another worker process who still saw the
ZEND_JIT_TRACE_JITED flag to schedule ZEND_JIT_TRACE_STOP_LINK, but
when it arrived at the ZEND_JIT_DEBUG_TRACE_STOP, the handler was
already reverted by the first worker process and thus
zend_jit_find_trace() fails.

This in turn generated a bogus jump offset in the JITed code, crashing
the PHP process.
2022-12-29 12:20:56 +00:00
David Carlier
381d0ddc20 Merge branch 'PHP-8.1' into PHP-8.2 2022-12-26 21:18:31 +00:00
Max Kellermann
b26b758952 ext/opcache/jit: handle zend_jit_find_trace() failures
Commit 6c25413 added the flag ZEND_JIT_EXIT_INVALIDATE which resets
the trace handlers in zend_jit_trace_exit(), but forgot to consider
that on ZEND_JIT_TRACE_STOP_LINK, this changed handler gets passed to
zend_jit_find_trace(), causing it to fail, either by returning 0
(results in bogus data) or by aborting due to ZEND_UNREACHABLE().  In
either case, this crashes the PHP process.

I'm not quite sure how to fix this multi-threading problem properly;
my suggestion is to just fail the zend_jit_trace() call.  After all,
the whole ZEND_JIT_EXIT_INVALIDATE fix was about reloading modified
scripts, so there's probably no point in this pending zend_jit_trace()
call.
2022-12-26 21:17:19 +00:00
Dmitry Stogov
0464524292 Fix memory leak because of incorrect optimization
Fixes oss-fuzz #54488
2022-12-26 13:20:55 +03:00
Niels Dossche
a24659e70c Update test for changed behaviour of GMP constructor
Closed GH-10160

Signed-off-by: George Peter Banyard <girgias@php.net>
2022-12-23 16:29:14 +00:00
Ilija Tovilo
db48f49888
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Add a regression test for auto_globals_jit=0 with preloading on
2022-12-22 17:42:27 +01:00
Niels Dossche
bbad29b9c1
Add a regression test for auto_globals_jit=0 with preloading on 2022-12-22 17:42:11 +01:00
Ilija Tovilo
c714e626c8
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Initialize ping_auto_globals_mask to prevent undefined behaviour
2022-12-22 15:00:00 +01:00
Niels Dossche
c4487b7a12
Initialize ping_auto_globals_mask to prevent undefined behaviour
Closes GH-10121
2022-12-22 14:59:24 +01:00
Arnaud Le Blanc
f1c345394b Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [ci skip] NEWS
  ext/opcache/jit/zend_jit: fix inverted bailout value in zend_runtime_jit() (#10144)
2022-12-21 14:55:36 +01:00
Max Kellermann
d3a6eedf4a
ext/opcache/jit/zend_jit: fix inverted bailout value in zend_runtime_jit() (#10144)
In the "catch" block, do_bailout must be set to true, not false, or
else zend_bailout() never gets called.
2022-12-21 14:53:21 +01:00
Derick Rethans
6b212b6dee Merge branch 'PHP-8.1' into PHP-8.2 2022-12-20 16:06:55 +00:00
Derick Rethans
d19a70c9a0 Fix GH-9891: DateTime modify with unixtimestamp (@) must work like setTimestamp 2022-12-20 14:41:13 +00:00
Christoph M. Becker
1abc1645dd
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Force extension loading for new test
2022-12-19 16:15:24 +01:00
Christoph M. Becker
da5cbca23e
Force extension loading for new test 2022-12-19 16:14:00 +01:00
Christoph M. Becker
6bd65cd8d2
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Skip newly added test on 32bit platforms
2022-12-19 16:07:08 +01:00
Christoph M. Becker
c702c9f0a3
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Skip newly added test on 32bit platforms
2022-12-19 16:06:18 +01:00
Christoph M. Becker
cf5dac07d2
Skip newly added test on 32bit platforms
That bug didn't affect 32bit platforms, and besides, it is rather
unlikely that allocating a 2GB string works on such platforms.
2022-12-19 16:04:29 +01:00
Stanislav Malyshev
32b6eacbc6 Merge branch 'PHP-8.1' into PHP-8.2 2022-12-18 23:21:25 -07:00
Stanislav Malyshev
a6a80eefe0 Improve fix for bug #81740 2022-12-18 23:20:29 -07:00
Stanislav Malyshev
5975f33c37 Merge branch 'PHP-8.0' into PHP-8.1 2022-12-18 23:02:09 -07:00
Stanislav Malyshev
5f90134bb6 Make build work with newer OpenSSL 2022-12-18 22:52:30 -07:00
Christoph M. Becker
921b6813da Fix #81740: PDO::quote() may return unquoted string
`sqlite3_snprintf()` expects its first parameter to be `int`; we need
to avoid overflow.
2022-12-18 22:41:43 -07:00
Christoph M. Becker
018fbd0a68
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-10112: LDAP\Connection::__construct() refers to ldap_create()
2022-12-16 14:37:39 +01:00
Christoph M. Becker
b8ac2071b8
Fix GH-10112: LDAP\Connection::__construct() refers to ldap_create()
There is no `ldap_create()`, but rather `ldap_connect()`.

Closes GH-10115.
2022-12-16 14:36:30 +01:00
George Peter Banyard
52a891aeaa
Add a new imap_is_open() function to check that a connection object is still valid 2022-12-13 23:48:03 +00:00
Mattias Ellert
a83923044c
Fix compilation on RHEL 7 ppc64le (gcc 4.8)
Fixes GH-10077
Closes GH-10078
2022-12-11 17:30:31 +01:00
Daniel Black
b77edf82ac
Fix mysqli test wrt. MariaDB
The test results under MariaDB, except they report "MariaDB" instead
of MySQL.

Closes GH-10029.
2022-12-09 16:09:23 +01:00