Commit Graph

134452 Commits

Author SHA1 Message Date
Niels Dossche
dd0f2abc80 Use param->len instead of strlen 2023-12-18 13:53:57 +00:00
Niels Dossche
e6e0231a98 Use asprintf return value for the size 2023-12-18 13:53:57 +00:00
Niels Dossche
b198d0cc0c Use precomputed length for phpdbg_try_file_init() 2023-12-18 13:53:57 +00:00
Niels Dossche
6991518685 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-12953: SSA integrity verification failed when loading composer classmaps with more than 11k elements
2023-12-18 13:15:44 +01:00
Niels Dossche
fc82c27a3d Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-12953: SSA integrity verification failed when loading composer classmaps with more than 11k elements
2023-12-18 13:15:19 +01:00
Niels Dossche
7585cf6952 Fix GH-12953: SSA integrity verification failed when loading composer classmaps with more than 11k elements
This is a false positive. The cycle detection code stops at 10.000
iterations. Instead of stopping at a fixed amount, make it more robust
by implementing Floyd's cycle detection algorithm.

Closes GH-12954.
2023-12-18 13:14:51 +01:00
Dmitry Stogov
d2e16a2199 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fixed type inference
2023-12-18 12:28:36 +03:00
Dmitry Stogov
555e8f82e8 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fixed type inference
2023-12-18 12:28:25 +03:00
Dmitry Stogov
731734dacb Fixed type inference
Fixes oss-fuzz #65150
2023-12-18 12:27:35 +03:00
Dmitry Stogov
45119549f0 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fixed incorrect elimination of refcounted check in JIT for BIND_GLOBAL
2023-12-18 11:31:45 +03:00
Dmitry Stogov
b46ee531bd Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fixed incorrect elimination of refcounted check in JIT for BIND_GLOBAL
2023-12-18 11:29:17 +03:00
Dmitry Stogov
c67f6f449c Fixed incorrect elimination of refcounted check in JIT for BIND_GLOBAL
Fixes oss-fuzz #65135
2023-12-18 11:27:55 +03:00
Dmitry Stogov
41a72655ae Update IR
IR commit: 1b50e33690406928a3f50491214b66460e82bb2c
2023-12-18 10:24:33 +03:00
Gina Peter Banyard
6da8b93ed5
ext/mbstring: Refactor mb_get_info() 2023-12-18 00:31:29 +00:00
Gina Peter Banyard
a6775c30c0
ext/mbstring: Refactor mb_trim_width() to take size_t arguments 2023-12-18 00:31:29 +00:00
Gina Peter Banyard
284b66be46
Merge branch 'PHP-8.3'
* PHP-8.3:
  add PDO::ATTR_AUTOCOMMIT to getAttribute
  Fix GH-12767: Fixed to be able to change autocommit mode using setAttribute
2023-12-18 00:28:14 +00:00
Gina Peter Banyard
dcef7039e8
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  add PDO::ATTR_AUTOCOMMIT to getAttribute
  Fix GH-12767: Fixed to be able to change autocommit mode using setAttribute
2023-12-18 00:27:58 +00:00
SakiTakamachi
2553ffeaa0
add PDO::ATTR_AUTOCOMMIT to getAttribute
Signed-off-by: Gina Peter Banyard <girgias@php.net>
2023-12-18 00:26:32 +00:00
SakiTakamachi
933dccb79b
Fix GH-12767: Fixed to be able to change autocommit mode using setAttribute
Signed-off-by: Gina Peter Banyard <girgias@php.net>
2023-12-18 00:26:32 +00:00
Marc Bennewitz
5d85378893 [ci skip] Added UPGRADING entry for GH-12413
Closes GH-12964.
2023-12-17 11:56:29 +01:00
Niels Dossche
61b7370b6d Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-12929: SimpleXMLElement with stream_wrapper_register can segfault
  Fix getting the address of an uninitialized property of a SimpleXMLElement resulting in a crash
  Fix GH-12962: Double free of init_file in phpdbg_prompt.c
2023-12-17 11:52:48 +01:00
Niels Dossche
f75931ad9e Fix GH-12929: SimpleXMLElement with stream_wrapper_register can segfault
Move SimpleXML invalidation code after node checks

This is safe, i.e. the tree hasn't been modified yet, because either we
didn't call a libxml modification function yet, or xmlNewChild is called
with a NULL pointer, which makes it bail out and return NULL.

Closes GH-12947.
2023-12-17 11:51:42 +01:00
Niels Dossche
4fc336c784 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix getting the address of an uninitialized property of a SimpleXMLElement resulting in a crash
  Fix GH-12962: Double free of init_file in phpdbg_prompt.c
2023-12-17 11:50:42 +01:00
Niels Dossche
abf4c116b1 Fix getting the address of an uninitialized property of a SimpleXMLElement resulting in a crash
Closes GH-12945.
2023-12-17 11:47:11 +01:00
Niels Dossche
a6d17bffe1 Fix GH-12962: Double free of init_file in phpdbg_prompt.c
See GH-12962 for analysis.

Closes GH-12963.
2023-12-17 11:46:02 +01:00
Niels Dossche
d8268f1aba
Change return type of registerNodeClass to true (#12960) 2023-12-16 19:06:56 +01:00
Niels Dossche
0870da3364
Use strcspn() to optimize dom_html5_escape_string() (#12948)
* Use strcspn() to optimize dom_html5_escape_string()

This routine implemented by libc uses a faster algorithm than the old
naive byte-per-byte approach here. It also is often optimized using
SIMD.

* Calculate mask outside of loop
2023-12-16 13:47:57 +01:00
Niels Dossche
82baeeb196
Some more DOM testing and code style updates (#12933) 2023-12-16 13:46:08 +01:00
Jakub Zelenka
d6299206dd
Merge branch 'PHP-8.3' 2023-12-15 14:14:15 +00:00
Jakub Zelenka
1b8be9acf0
Merge branch 'PHP-8.2' into PHP-8.3 2023-12-15 14:13:41 +00:00
Jakub Zelenka
40ccc8ea7e
Fix GH-9698: stream_wrapper_register crashes with FFI\CData provided as class
Closes GH-12926
2023-12-15 14:11:56 +00:00
Niels Dossche
ab5edb6a8e Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix 32-bit ext/hash build
2023-12-13 19:33:29 +01:00
Niels Dossche
4269f046c2 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix 32-bit ext/hash build
2023-12-13 19:33:20 +01:00
Niels Dossche
2ee4d358dc Fix 32-bit ext/hash build 2023-12-13 19:33:09 +01:00
Ilija Tovilo
b10e357461
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix clean for higher branches
2023-12-13 15:22:15 +01:00
Ilija Tovilo
aa52c29f28
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix clean for higher branches
2023-12-13 15:22:09 +01:00
Ilija Tovilo
23ea89404b
Fix clean for higher branches 2023-12-13 15:21:19 +01:00
Ilija Tovilo
e2972e4c15
Merge branch 'PHP-8.3'
* PHP-8.3:
  Disambiguate fileVar8 test folder
2023-12-13 14:32:01 +01:00
Ilija Tovilo
cb38d7b23f
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Disambiguate fileVar8 test folder
2023-12-13 14:31:56 +01:00
Ilija Tovilo
cda7718f51
Disambiguate fileVar8 test folder
Closes GH-12951
2023-12-13 14:31:40 +01:00
Ilija Tovilo
c00b0c7477
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix SELinux mprotect execheap error due to mem adjacent to heap
2023-12-13 11:26:36 +01:00
Ilija Tovilo
719236e3ec
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix SELinux mprotect execheap error due to mem adjacent to heap
2023-12-13 11:26:23 +01:00
Ilija Tovilo
7cf1a2ad9d
Fix SELinux mprotect execheap error due to mem adjacent to heap
It seems SELinux has a bug where memory directly adjacent to the heap is
interpreted as heap memory. Dodge this issue by leaving some space between the
heap and memory suggested by find_prefered_mmap_base.

See GH-12932
See https://bugzilla.kernel.org/show_bug.cgi?id=218258
Closes GH-12942
2023-12-13 11:25:48 +01:00
Ilija Tovilo
be46545ee0
Fix pcre out-of-bounds when using closing symbols as opening delimiter (#12946)
Apparently we support using closing symbols )]}> as opening and closing
delimiters.

Fixes oss-fuzz #65021
2023-12-12 21:58:34 +01:00
Niels Dossche
0917a3636e Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-12936: hash() function hangs endlessly if using sha512 on strings >= 4GiB
2023-12-12 19:58:21 +01:00
Niels Dossche
cd179171cc Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-12936: hash() function hangs endlessly if using sha512 on strings >= 4GiB
2023-12-12 19:57:47 +01:00
Niels Dossche
2b8c00850b Fix GH-12936: hash() function hangs endlessly if using sha512 on strings >= 4GiB
There's two problems:
- Some loops used `unsigned int` instead of `size_t`.
- The 2*N-bit addition that is emulated using 2 N bit numbers has a bug:
  it first truncated the number to 32/64 bit and only then shifted. This
  resulted in the wrong length info stored inside the resulting hash.

Closes GH-12937.
2023-12-12 19:57:06 +01:00
Niels Dossche
34ec4b3568
More testing of mime_sniff and fix off-by-one causing trailing whitespace to not be always stripped (#12935) 2023-12-12 17:44:36 +01:00
Niels Dossche
e78966386b Remove always-false condition from substr_replace()
l < 0 is checked before and set to a different value.
2023-12-12 16:43:43 +00:00
Niels Dossche
ea5521c68c Remove always-false condition from stream_is_local()
php_stream_from_zval returns if the value is NULL.
2023-12-12 16:43:43 +00:00