1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Commit Graph

69227 Commits

Author SHA1 Message Date
Gina Peter Banyard
df8ac4af91 ext/pdo_odbc: Do not populate message if there is no driver error (#17478) 2025-01-15 20:46:08 +00:00
David Carlier
951d2f81c7 Merge branch 'PHP-8.4' 2025-01-15 20:37:19 +00:00
David Carlier
6979a7a954 ext/pcntl: Fix pcntl_setcpuaffinity exception type for invalid cpu id.
found while working [on the doc](https://github.com/php/doc-en/pull/4346).

close GH-17474
2025-01-15 20:36:18 +00:00
Gina Peter Banyard
b7169a2248 ext/soap: Don't call readfile() userland function (#17432)
* ext/soap: Add some SoapServer tests

* ext/soap: Don't call readfile() userland function

We can perform the operation directly, moreover there is no risk of a user disabling the readfile function and defining their own messing up what we are doing.

* ext/soap: Actually throw a SOAP Fault if the WSDL has disappeared
2025-01-15 14:37:44 +00:00
Christoph M. Becker
7512685767 Use built-ins for addition and subtraction on Windows (GH-17472)
For Clang, we just need to define the respective macros, since these
built-ins are available in all supported Clang versions (>= 4.0.0,
currently)[1].

For MSVC (and possibly other compilers) we use the respective APIs of
intsafe.h[2] which are available as of Windows 7/Server 2008 R2.

This avoids the UB due to signed integer overflow that may happen with
our fallback implementations.

We also drop the superfluous SHORT_MAX definition from pdo_firebird.
This shouldn't be defined unconditionally, but since it is apparently
unused, we remove it altogether.

[1] <https://releases.llvm.org/4.0.0/tools/clang/docs/LanguageExtensions.html>
[2] <https://learn.microsoft.com/en-us/windows/win32/api/intsafe/>
2025-01-15 12:58:12 +01:00
Gina Peter Banyard
abfa377fae ext/pdo: Add FETCH_INTO setting via setAttribute "hack" 2025-01-15 03:02:30 +00:00
Gina Peter Banyard
dfcac15739 ext/pdo: Rename variable, because i is really not descriptive 2025-01-15 03:02:30 +00:00
Dmitry Stogov
4c84ed4d98 Merge branch 'PHP-8.4'
* PHP-8.4:
  Update IR
2025-01-15 02:46:08 +03:00
Dmitry Stogov
9aaa469f99 Update IR
IR commit: d6d7fc489137aab218b04b59d770b497c5ae3832
2025-01-15 02:45:24 +03:00
Niels Dossche
650e59a1c2 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-17428: Assertion failure ext/opcache/jit/zend_jit_ir.c:8940
2025-01-14 22:38:18 +01:00
Niels Dossche
3524702fe1 Fix GH-17428: Assertion failure ext/opcache/jit/zend_jit_ir.c:8940
The code to update the call_level in that case skips the opline itself,
as that's handled by the tail handler, and then wants to set the opline
to the last opline of the block because the code below the switch will
update the call_level for that opline.
However, the test has a block with a single opline (THROW). The block
after that has ZEND_INIT_FCALL, because `i` points to ZEND_INIT_FCALL
now, it erroneously causes the call_level after the switch.

Closes GH-17438.
2025-01-14 22:37:41 +01:00
David Carlier
a4e25839d3 Merge branch 'PHP-8.4' 2025-01-14 18:33:00 +00:00
David Carlier
b1e0176455 Merge branch 'PHP-8.3' into PHP-8.4 2025-01-14 18:32:51 +00:00
David Carlier
e4473abefc Fix GH-17463: SplTempFileObject::ftruncate() segfault on negative length.
close GH-465
2025-01-14 18:32:01 +00:00
Gina Peter Banyard
af1e289332 ext/json: Refactor php_json_encode_serializable_object() to call method directly 2025-01-13 13:46:25 +00:00
Gina Peter Banyard
75a15cf640 ext/json: Use zend_result type instead of int 2025-01-13 13:46:25 +00:00
Christoph M. Becker
aac71904ca Don't pass -fwrapv to clang on Windows (GH-17458)
This is apparently not supported there; the VS supplied clang version
18.1.8, reports:

`clang-cl: warning: unknown argument ignored in clang-cl: '-fwrapv' [-Wunknown-argument]`
2025-01-13 14:10:23 +01:00
Christoph M. Becker
788128aec7 Fix -Wpointer-type-mismatch warning (GH-17453)
`GetProcAddress()` returns a `FARPROC` (aka. `long long (*)()`) which
is not compatible with `void *` per the specs.  However, on Windows
they are, so we silence the warning with a cast.
2025-01-13 13:04:19 +01:00
Christoph M. Becker
1675d32261 Fix printf style issues in Windows specific code (GH-17452)
A couple of calls pass strings as formats (`-Wformat-security`), and
some others mix up types (`-Wformat`).
2025-01-13 11:50:05 +01:00
Christoph M. Becker
26bf239e6d Resolve -Wincompatible-pointer-types warnings (GH-17456)
The phpdbg issue is a real issue, although it's unlikely that harm can
be done due to stack alignment and little-endianess.  The others seem
to be more cosmetic.
2025-01-13 10:54:13 +01:00
Niels Dossche
f99d62013b Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-17139: Fix zip_entry_name() crash on invalid entry
2025-01-12 20:42:59 +01:00
Niels Dossche
fd0cabbbe4 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-17139: Fix zip_entry_name() crash on invalid entry
2025-01-12 20:42:53 +01:00
Niels Dossche
d08a9e0010 Fix GH-17139: Fix zip_entry_name() crash on invalid entry
Don't increment the refcount, but latter remember the ID to check
afterwards whether the resource still exists.

Replaces GH-17142.
Closes GH-17439.
2025-01-12 20:37:51 +01:00
Niels Dossche
e6f42c1ed0 Fix incorrect casts 2025-01-11 10:50:07 +01:00
Gina Peter Banyard
11937b3df7 ext/pdo: Add a test for PDO::FETCH_FUNC with a return by-ref callback (#17425) 2025-01-10 17:27:19 +00:00
Niels Dossche
e8fce295bc Backport fix GH-17307
This is a backport of GH-17319 to fix GH-17307 on lower branches.

Closes GH-17424.
2025-01-10 18:24:25 +01:00
Gina Peter Banyard
8d79ed6b3e ext/pdo: Refactor PDO::FETCH_FUNC to not rely on an FCI on the struct (#17420) 2025-01-09 22:22:52 +00:00
Dmitry Stogov
2d4155a6a9 Merge branch 'PHP-8.4'
* PHP-8.4:
  Update IR
2025-01-10 00:35:33 +03:00
Dmitry Stogov
4763193567 Update IR
IR commit: e445f57f3a936584db28489a49098d52f03388a7
2025-01-10 00:34:58 +03:00
Niels Dossche
8c443016e9 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-17307: Internal closure causes JIT failure
  Generate inline frameless icall handlers only if the optimization level is set to inline
  Fix GH-15981: Segfault with frameless jumps and minimal JIT
  Fix GH-15833: Segmentation fault (access null pointer) in ext/spl/spl_array.c
2025-01-09 20:01:16 +01:00
Niels Dossche
28b448ac20 Fix GH-17307: Internal closure causes JIT failure
`bcadd(...)` is a closure for an internal function, and
`zend_jit_push_call_frame` takes into account both last_var and the
difference in argument numbers not only for user code but also for
internal code. However, this is inconsistent with
`zend_vm_calc_used_stack`, causing argument corruption.
Making this consistent fixes the issue.

I could only reproduce the assertion failure when using Valgrind.

Closes GH-17319.
2025-01-09 19:59:38 +01:00
Niels Dossche
c790c5b2e7 Generate inline frameless icall handlers only if the optimization level is set to inline 2025-01-09 19:59:10 +01:00
Niels Dossche
72184abd2f Fix GH-15981: Segfault with frameless jumps and minimal JIT
Minimal JIT shouldn't generate a call to the complex handler, but
instead rely on the VM and then check for a two-way jump.
This moves the frameless codegen under the check `JIT_G(opt_level) >=
ZEND_JIT_LEVEL_INLINE`.
2025-01-09 19:59:03 +01:00
Niels Dossche
b666dc9788 Fix GH-15833: Segmentation fault (access null pointer) in ext/spl/spl_array.c
We're accessing the object properties table directly in spl, but we're
not accounting for lazy objects. Upon accessing we should trigger the
initialization as spl is doing direct manipulations on the object
property table and expects a real object.

Closes GH-17235.
2025-01-09 19:58:00 +01:00
Niels Dossche
5d4707e22a Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-17409: Assertion failure Zend/zend_hash.c:1730
  NEWS
  Add comment
  Fix GH-16892: ini_parse_quantity() fails to parse inputs starting with 0x0b
  Fix GH-16886: ini_parse_quantity() fails to emit warning for 0x+0
  Merge duplicate code blocks
2025-01-09 19:54:52 +01:00
Niels Dossche
3eb79e146f Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-17409: Assertion failure Zend/zend_hash.c:1730
  NEWS
  Add comment
  Fix GH-16892: ini_parse_quantity() fails to parse inputs starting with 0x0b
  Fix GH-16886: ini_parse_quantity() fails to emit warning for 0x+0
  Merge duplicate code blocks
2025-01-09 19:54:46 +01:00
Niels Dossche
a2a7287b87 Fix GH-17409: Assertion failure Zend/zend_hash.c:1730
The array merging function may still hold the properties array while the
object is already being destroyed. Therefore, we should take into
account the refcount in simplexml's destruction code.
It may be possible to trigger this in other ways too.

Closes GH-17421.
2025-01-09 19:53:54 +01:00
Gina Peter Banyard
cc3a729995 ext/ldap: Fix FCC is initialized condition 2025-01-09 16:42:58 +00:00
David Carlier
adcd3ad46b Merge branch 'PHP-8.4' 2025-01-09 13:46:39 +00:00
David Carlier
e975c27e12 Fix GH-17400: bindtextdomain segfault with UTF-16 domain value.
The provided domain could be a non ascii value even if not supposed to,
in the error reported case was of 4 code points long but domain is "empty" leading to
a NULL return. It worked up to 8.3 "by accident" before the zend_string
conversion and check prior for emptiness.

close GH-17402
2025-01-09 13:45:59 +00:00
Christoph M. Becker
0f40e62ca7 Fix bug 68629: Transparent artifacts when using imagerotate
We port the respective upstream fix[1], which dropped the special cased
implementations of fixed-point arithmetic rotation in favor of the
generic implementation.

We also port follow-up upstream fixes[2][3].

[1] <bd6d2e101f>
[2] <6d21d30429>
[3] <9df878a400>

Closes GH-17375.
2025-01-09 13:19:25 +01:00
Christoph M. Becker
757faee9ec Merge branch 'PHP-8.4'
* PHP-8.4:
  Add support for reading GIFs without colormap
2025-01-09 12:07:03 +01:00
Christoph M. Becker
38365a44d0 Add support for reading GIFs without colormap
Cf. <fc38677e80>.

Closes GH-17364.
2025-01-09 12:06:24 +01:00
Gina Peter Banyard
fba0b18d35 ext/pdo: Remove mostly useless retval field in statement struct 2025-01-09 10:30:10 +00:00
Gina Peter Banyard
bd83f866d1 ext/pdo: Refactor FETCH_FUNCTION mode
Most of the fields on the struct are useless or can be handled differently
2025-01-09 10:30:10 +00:00
Gina Peter Banyard
576f5fac23 ext/pdo: Move PDO MySQL test to common 2025-01-09 10:30:10 +00:00
Niels Dossche
3a039e3725 Add enchant_dict_remove_from_session() (#17393) 2025-01-08 21:53:40 +01:00
Gina Peter Banyard
915feea12d ext/ldap: Use FCC for rebind_proc callback (#17369) 2025-01-08 20:52:33 +00:00
Niels Dossche
1ec95c33e8 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix crashes in enchant when passing null bytes
2025-01-08 20:47:37 +01:00
Niels Dossche
91384e561f Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix crashes in enchant when passing null bytes
2025-01-08 20:47:31 +01:00