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

136115 Commits

Author SHA1 Message Date
Eric Mann
2fe579bc26 Update versions for PHP 8.3.29 php-8.3.29 2025-12-16 06:32:42 -08:00
Niels Dossche
5eefdbc455 intl: Fix tests for icu update 2025-12-14 22:19:31 +01:00
Jakub Zelenka
304596bbf8 Update NEWS with info about security issues 2025-12-14 19:40:16 +01:00
Niels Dossche
56cbadf468 Fix GHSA-www2-q4fc-65wf 2025-12-14 19:40:16 +01:00
Niels Dossche
3529508a7a Fix GHSA-h96m-rvf9-jgm2 2025-12-14 19:40:12 +01:00
Jakub Zelenka
ecf82e74b6 Fix GHSA-8xr5-qppj-gvwj: PDO quoting result null deref 2025-12-12 11:55:39 +01:00
David Carlier
08bd4909fe Fix GH-20603 issue on windows 32 bits.
the timeout needed to be unsigned.

close GH-20634

(cherry picked from commit ff51ac161d)
2025-12-12 11:51:33 +01:00
Ilija Tovilo
16ce2ff13f Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  dom: Fix compile warning due to misplaced const cast
2025-12-02 17:00:06 +01:00
Ilija Tovilo
bdc09a0c50 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  dom: Fix compile warning due to misplaced const cast
2025-12-02 16:59:59 +01:00
Niels Dossche
bd67ba66a8 dom: Fix compile warning due to misplaced const cast 2025-12-02 16:59:51 +01:00
Ilija Tovilo
685bd9de81 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Suppress libxml deprecations
2025-12-02 16:41:37 +01:00
Ilija Tovilo
26b9395ad6 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Suppress libxml deprecations
2025-12-02 16:38:08 +01:00
Ilija Tovilo
f7fb13eb07 Suppress libxml deprecations
Closes GH-20538
2025-12-02 16:37:50 +01:00
Daniel Scherzer
c343ede18d Fix GH-20426: fix Spoofchecker::setRestrictionLevel() error (#20427) 2025-12-01 13:37:49 -08:00
Niels Dossche
366ed4c750 Fix GH-20614: SplFixedArray incorrectly handles references in deserialization
All other code caters to dereferencing array elements, except the
unserialize handler. This causes references to be present in the fixed
array even though this seems not intentional as reference assign is
otherwise impossible.
On 8.5+ this causes an assertion failure. On 8.3+ this causes references
to be present where they shouldn't be.

Closes GH-20616.
2025-11-30 10:41:32 +01:00
David Carlier
4312a446d0 Fix GH-20601: ftp_connect() timeout argument overflow.
close GH-20603
2025-11-29 23:05:14 +00:00
David Carlier
c8e13af455 Fix GH-20602: imagescale() overflow with large height values.
close GH-20605
2025-11-29 13:30:49 +00:00
Niels Dossche
8fe7930533 Fix GH-20584: Information Leak of Memory
The string added had uninitialized memory due to
php_read_stream_all_chunks() not moving the buffer position, resulting
in the same data always being overwritten instead of new data being
added to the end of the buffer.

Closes GH-20592.
2025-11-28 18:38:48 +01:00
Niels Dossche
292a7f73ba Fix GH-20583: Stack overflow in http_build_query via deep structures
Closes GH-20590.
2025-11-28 18:38:18 +01:00
Niels Dossche
27f17c3322 Fix GH-20286: use-after-destroy during userland stream_close()
Closes GH-20493.

Co-authored-by: David Carlier <devnexen@gmail.com>
2025-11-23 17:46:28 +01:00
David Carlier
9149c35514 Fix GH-20554: php_cli_server() get http status as string build issue.
due to the signature of this helper it needs to be const also
bsearch key argument needs to be too.

close GH-20556
2025-11-22 22:25:33 +00:00
David Carlier
f88d247ce2 Fix GH-20551: imagegammacorrect out of range gamma value.
close GH-20552
2025-11-22 22:22:27 +00:00
Remi Collet
769f319867 NEWS 2025-11-21 09:19:38 +01:00
Remi Collet
9d71c1e0b6 Fix GH-20528: Regression breaks mysql connexion using an IPv6 address enclosed in square brackets 2025-11-21 09:17:20 +01:00
Niels Dossche
159ef1401c Fix GH-20492: mbstring compile warning due to non-strings
This is a partial backport of ea69276f, but without changing public
headers as that's not allowed at this point.

Closes GH-20494.
2025-11-20 19:17:55 +01:00
Niels Dossche
a1912e3cdd Fix GH-20491: SLES15 compile error with mbstring oniguruma
The issue is specific to SLES15.
Arguably this should be reported to them as it seems to me they meddled
with the oniguruma source code.

The definition in oniguruma.h on that platform looks like this (same as upstream):
```c
ONIG_EXTERN
int onig_error_code_to_str PV_((OnigUChar* s, int err_code, ...));
```

Where `PV_` is defined as (differs):
```c
#ifndef PV_
#ifdef HAVE_STDARG_PROTOTYPES
# define PV_(args) args
#else
# define PV_(args) ()
#endif
#endif
```

So that means that `HAVE_STDARG_PROTOTYPES` is unset.
This can be set if we define `HAVE_STDARG_H`,
which we can do because PHP requires at least C99 in which the header
is always available.
We could also use an autoconf check, but this isn't really necessary as
it will always succeed.
2025-11-20 19:17:17 +01:00
Niels Dossche
8c2407714f libxml: Fix input buffer deprecation
While this fixed the last deprecation in ext/libxml, it's not a full
fix: The full fix would be to move to the context-specific APIs to
override the behaviour. However, that requires API/ABI incompatible
changes so that can't be done on a stable branch.

Closes GH-20525.
2025-11-19 18:41:28 +01:00
Niels Dossche
2f05830a5f zip: Don't truncate return value of zip_fread() with user sizes
The return type has been zip_int64_t since 2009, so we shouldn't
truncate to an int because the user may have requested a size that won't
fit in an int.

Closes GH-20509.
2025-11-18 20:30:42 +01:00
Niels Dossche
6054a900ff libxml: Fix some deprecations regarding input buffer/parser handling
Closes GH-20514.
2025-11-18 18:53:17 +01:00
Ilija Tovilo
24f4799783 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [skip ci] Fix Symfony PHP requirements in community build
2025-11-18 00:52:21 +01:00
Ilija Tovilo
7ceee594bf Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [skip ci] Fix Symfony PHP requirements in community build
2025-11-18 00:52:14 +01:00
Ilija Tovilo
599d5ae64c [skip ci] Fix Symfony PHP requirements in community build
Symfony 8.1 and 8.0 now require PHP 8.4. Use 7.4 for PHP 8.3 and 8.2 builds. PHP
8.1 continues to be skipped. Sadly, this will need to be updated sporadically.

Closes GH-20512
2025-11-18 00:51:39 +01:00
Niels Dossche
93ce0500aa Fix assertion failures resulting in crashes with stream filter object parameters
This works for dynamic props but not for non-dynamic props due to the
missing INDIRECT handling.

Closes GH-20500.
2025-11-17 18:23:43 +01:00
Niels Dossche
46a15ed439 Fix crash in property existence test in ext/zip
When type == 2, the zval is not initialized, so zval_ptr_dtor() on it
will crash.
Unfortunately couldn't test with property_exists() or Reflection because
they have fast paths that go through the property info, but fortunately
there are paths that don't implement a fast path (e.g. because it
doesn't make sense at that point), like with array_column().
So we use array_column() to trigger the crash.

Closes GH-20496.
2025-11-16 21:28:30 +01:00
David Carlier
d2c5b3b25b Fix GH-20483: ASAN stack overflow with small fiber.stack_size INI value.
close GH-20495
2025-11-15 17:20:29 +00:00
Niels Dossche
d9e40372fc Fix assertion failure when fseeking a phar file out of bounds
In 61884c3b52 I added these FIXME comments after I noticed that this
would cause an assertion failure. At that time I did not yet know what
to do here. I took a look at the code now and other streams return -1
and leave the file position untouched. So we do the same for phar.
This fixes the assertion failure and subsequent crashes, but also
changes one test output. However, I believe the new test output is
correct.

Closes GH-20475.
2025-11-15 14:33:33 +01:00
Niels Dossche
2f9d86b677 phar: Fix broken return value of fflush() for phar file entries
The flush functions always return EOF, even in the success path.
The success path should return 0 to indicate success.

Closes GH-20474.
2025-11-15 13:56:06 +01:00
Niels Dossche
48b19a8ede xml: Use safe_emalloc() correctly
Fortunately, libxml won't allow _at this point in time_ to have more
than INT_MAX/5 attributes, so this doesn't cause issues right now.
However, if this limit is ever raised then it can cause an integer
overflow which will cause a heap overflow.
So future-proof this code by properly using safe_emalloc().

Closes GH-20472.
2025-11-15 12:45:28 +01:00
Gina Peter Banyard
37e61a0dc0 sapi/phpdbg: fixed ZPP type violation by using 'h' ZPP specifier instead of 'H'
This aligns the behaviour with what the stubs say.
And even if one fixes the stubs the behaviour is not identical due to missing indirect handling.

This indicates that using objects is never done, so do the easy fix of changing the ZPP specifier.

Closes GH-20465
2025-11-13 01:30:49 +00:00
Niels Dossche
8ad5915756 dom: Fix missing NUL byte check on C14NFile()
Closes GH-20466.
2025-11-13 00:03:13 +01:00
Gina Peter Banyard
414e7db68a sapi/phpdbg: use 'h' ZPP specifier instead of'H'
The stubs say array so in debug mode we get a ZPP violation assertion and even by fixing the stubs the behaviour is not identical due to missing indirect handling.

This indicates using objects was never done, thus use the correct ZPP specifier
2025-11-12 16:01:43 +00:00
Ilija Tovilo
b620d9d228 Correctly handle extra named args for magic call in debug_backtrace_get_args()
Closes GH-20454
2025-11-12 00:33:02 +01:00
Niels Dossche
3cc36b0b5e Fix GH-20439: xml_set_default_handler() does not properly handle special characters in attributes when passing data to callback (#20453)
We would need to escape the attributes, but there's no builtin method
that we can call in libxml2 to do so in a way consistent with the
attribute escape rules and expat.
In fact, expat just repeats the input, while we reconstruct it.
To fix the issue, and fix consistency with expat, we repeat the input as
well. This works by seeking to the start and end of the tag and passing
it to the default handler. This is fine for the parser because the
parser used in ext/xml is always in non-progressive mode, so we have
access to the entire input buffer.
2025-11-11 22:47:15 +01:00
Niels Dossche
33a2acba44 Fix GH-20435: SensitiveParameter doesn't work for named argument passing to variadic parameter
Closes GH-20436.
2025-11-10 22:43:17 +01:00
Niels Dossche
4ee25395d5 Fix GH-20442: Phar does not respect case-insensitiveness of __halt_compiler() when reading stub
Functions are case insensitive. The flush code already takes this into
account by checking for the __halt_compiler() symbol in a case
insensitive manner; however the parsing code did not do that yet.

Closes GH-20445.
2025-11-10 22:42:32 +01:00
Niels Dossche
80b731659a Fix memory leak in array_diff() with custom type checks
Closes GH-20428.
2025-11-08 22:41:44 +01:00
Ilija Tovilo
ae01a8adcc Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  ext/pcre/tests: support libpcre2-10.47
2025-11-07 18:53:22 +01:00
Ilija Tovilo
b4e8635f5c Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  ext/pcre/tests: support libpcre2-10.47
2025-11-07 18:53:16 +01:00
Michael Orlitzky
bdf62b55bb ext/pcre/tests: support libpcre2-10.47
In the latest version of libpcre2, the offsets appearing in some
"compilation failed" warnings have increased by one, as a result of

  https://github.com/PCRE2Project/pcre2/pull/756

This is causing spurious test failures, so in this commit we replace
the hard-coded offsets by a regex that matches both values.

Gentoo-bug: https://bugs.gentoo.org/965018

Closes GH-20397
2025-11-07 18:52:48 +01:00
Michael Voříšek
3b2f03d16c Sync all boost.context files with release 1.86.0
Closes GH-20375.
2025-11-06 22:56:51 +01:00