1
0
mirror of https://github.com/php/php-src.git synced 2026-04-23 07:58:20 +02:00
Commit Graph

127779 Commits

Author SHA1 Message Date
Daniel Black 2b3fa5edac zend win32 RE2C header files to Make targets and generated_files
like zend_ini_parser.h, list zend_ini_scanner_defs.h and
zend_language_scanner_defs.h.

Add all these files to generated_files so they don't get missed.
2023-02-17 16:37:14 +00:00
Daniel Black e83cda0887 ext/Zend: zend_language_scanner_defs.h as make target 2023-02-17 16:37:13 +00:00
Daniel Black 2fde3afffb ext/json: add php_json_scanner_defs.h as make target
To prevent build failures like:

make: *** No rule to make target '/code/master/ext/json/php_json_scanner_defs.h', needed by 'ext/json/json_scanner.lo'.  Stop.
2023-02-17 16:37:13 +00:00
Ilija Tovilo 52c96f21be [skip ci] Skip slow tidy test on asan 2023-02-17 14:56:28 +01:00
Jakub Zelenka fd3cc17cbd Add max_multipart_body_parts info into php.ini files 2023-02-17 13:21:18 +00:00
Ilija Tovilo 7b68ff46da Revert "Fix GH-10168: heap-buffer-overflow at zval_undefined_cv"
This reverts commit 71ddede565.
2023-02-16 14:07:17 +01:00
Ben Ramsey d9ac59b0a9 Ensure tar is not bsdtar 2023-02-14 14:13:01 -06:00
Ben Ramsey 843ba82b53 Use gtar if it's in the PATH 2023-02-14 13:49:02 -06:00
Ben Ramsey 586e81b259 Point to the issue tracker on GitHub 2023-02-14 13:49:02 -06:00
Tim Düsterhus 5e69d76bbc Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  [ci skip] Next release will be 8.0.29
2023-02-14 20:27:53 +01:00
Niels Dossche e35e6dc351 [ci skip] NEWS (#10586) 2023-02-14 20:27:29 +01:00
Gabriel Caruso 0e45ed772d [ci skip] Next release will be 8.0.29 2023-02-14 15:19:11 +01:00
Remi Collet b11d855dbf Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  more config for new FPM tests
2023-02-14 14:14:03 +01:00
Remi Collet e86d8704b4 more config for new FPM tests 2023-02-14 14:13:40 +01:00
Jakub Zelenka 4058d20608 Merge branch 'PHP-8.0' into PHP-8.1 2023-02-14 10:52:17 +00:00
Jakub Zelenka 937b1e38e2 Fix missing colon in NEWS 2023-02-14 10:46:48 +00:00
Jakub Zelenka eef29d434a Change NEWS for GHSA-54hq-v5wp-fqgv as it is for all SAPIs 2023-02-14 10:42:40 +00:00
Jakub Zelenka caaaf75990 Fix incorrect character in NEWS 2023-02-14 10:33:56 +00:00
Jakub Zelenka 054c7b09f9 Update NEWS 2023-02-14 10:23:59 +00:00
Jakub Zelenka 716de0cff5 Introduce max_multipart_body_parts INI
This fixes GHSA-54hq-v5wp-fqgv DOS vulnerabality by limitting number of
parsed multipart body parts as currently all parts were always parsed.
2023-02-14 10:21:23 +00:00
Jakub Zelenka e45850c195 Fix repeated warning for file uploads limit exceeding 2023-02-14 10:21:07 +00:00
Niels Dossche d94ddbed2c Fix updating SSA object type for *_ASSIGN_OP (#10458)
The code fetched the class entry into ce for objects and static
properties. However, when the actual update needs to take place (when
result_def exists), the class entry in ce was reset to NULL. So the SSA
object type update never happened. Fetch the class entry in the
result_def>=0 case instead after the reset of ce to NULL.
2023-02-14 11:29:29 +03:00
Niels Dossche 1a5fc6e1a3 Fix assertion failure when var_dump'ing void FFI result (#10568) 2023-02-13 22:38:28 +03:00
Ben Ramsey 28d68f5013 PHP-8.1 is now for PHP 8.1.17-dev 2023-02-13 13:16:07 -06:00
Bob Weinand 95016138a5 Fix GH-10496: Fibers must not be garbage collected while implicitly suspended by resumption of another fiber 2023-02-13 16:30:21 +00:00
Arnaud Le Blanc d721dcc2ef Fix colletion of unfinished function call in fibers
Fixes GH-10496.

Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
2023-02-13 13:09:04 +01:00
Stanislav Malyshev 85d9278db2 Merge branch 'PHP-8.0' into PHP-8.1 2023-02-12 21:33:39 -07:00
Stanislav Malyshev b5ccaaf613 Update NEWS 2023-02-12 21:04:31 -07:00
Niels Dossche ec10b28d64 Fix array overrun when appending slash to paths
Fix it by extending the array sizes by one character. As the input is
limited to the maximum path length, there will always be place to append
the slash. As the php_check_specific_open_basedir() simply uses the
strings to compare against each other, no new failures related to too
long paths are introduced.
We'll let the DOM and XML case handle a potentially too long path in the
library code.
2023-02-12 20:56:19 -07:00
Stanislav Malyshev af2ddc6426 Update NEWS 2023-02-12 20:53:06 -07:00
Tim Düsterhus a92acbad87 crypt: Fix possible buffer overread in php_crypt() 2023-02-12 20:46:51 -07:00
Tim Düsterhus c840f71524 crypt: Fix validation of malformed BCrypt hashes
PHP’s implementation of crypt_blowfish differs from the upstream Openwall
version by adding a “PHP Hack”, which allows one to cut short the BCrypt salt
by including a `$` character within the characters that represent the salt.

Hashes that are affected by the “PHP Hack” may erroneously validate any
password as valid when used with `password_verify` and when comparing the
return value of `crypt()` against the input.

The PHP Hack exists since the first version of PHP’s own crypt_blowfish
implementation that was added in 1e820eca02.

No clear reason is given for the PHP Hack’s existence. This commit removes it,
because BCrypt hashes containing a `$` character in their salt are not valid
BCrypt hashes.
2023-02-12 20:46:44 -07:00
Ilija Tovilo 18b611d6a0 Temporarily disable odbc in ci
The unixodbc.h header is suddenly missing.
2023-02-11 13:22:27 +01:00
Ilija Tovilo 13c34aac05 Mark test as XFAIL
See https://github.com/php/php-src/pull/10546
2023-02-11 00:21:01 +01:00
George Peter Banyard 704aadd098 Fix memory leaks in ext-tidy
We must not instantiate the object prior checking error conditions
Moreover, we need to release the HUGE amount of memory for files which are over 4GB when throwing a ValueError

Closes GH-10545
2023-02-10 14:12:23 +00:00
Max Kellermann 8c8a38a75c ext/curl: suppress -Wdeprecated-declarations
Closes GH-10531.
2023-02-08 18:32:13 +00:00
Niels Dossche 71ddede565 Fix GH-10168: heap-buffer-overflow at zval_undefined_cv
The problem is that we're using the variable_ptr in the opcode handler
*after* it has already been destroyed. The solution is to create a
specialised version of zend_assign_to_variable which takes in two
destination zval pointers.

Closes GH-10524
2023-02-08 01:06:50 +01:00
Max Kellermann e6281db857 php.ini-production: disable opcache.huge_code_pages by default
There are only very narrow circumstances under which this option has
been reported to provide 1% performance gain due to reduction of TLB
misses.  In many setups, this option only increases memory usage, and
will actually decrease performance.  To avoid this, let's leave it
disabled by default, and let it be an explicit decision to enable it.

For a discussion, see https://github.com/php/php-src/pull/10301

Closes GH-10336
2023-02-07 22:51:55 +00:00
Max Kellermann 0752baa583 Zend/zend_cpuinfo, ext/standard/crc32_x86: fix -Wstrict-prototypes
In plain C, a function without arguments must be explicitly declared
(void).

Close GH-10528
2023-02-07 22:47:43 +00:00
Ben Ramsey ba282f1b2f Update NEWS 2023-02-07 09:28:50 -06:00
Michael Voříšek 4df4264ac9 Fix PDO OCI Bug #60994 (Reading a multibyte CLOB caps at 8192 chars) 2023-02-07 09:25:34 -06:00
Max Kellermann 131b862ac0 ext/opcache/zend_jit: call TSRM dtor before unloading opcache.so (#10533)
Commit a21195650e added a TSRM destructor, but that destructor
will get called by tsrm_shutdown(), which is after opcache.so has
already been unloaded, resulting in a shutdown crash, e.g.:

  #0  0x00007fad01737500 in ?? ()
  #1  0x000055ac54e723c4 in tsrm_shutdown () at TSRM/TSRM.c:194
  #2  0x000055ac54c42180 in main (argc=80, argv=0x55ac57bc14d0) at sapi/cli/php_cli.c:1388

By calling ts_free_id() before opcache.so gets unloaded, we can easily
fix this crash bug.
2023-02-07 16:09:17 +03:00
Ilija Tovilo c95125d370 Disable timestamp for GitHub actions ccache 2023-02-07 12:05:01 +01:00
Max Kellermann afbb28dfb7 ext/opcache/zend_jit: cast function to fix -Wincompatible-pointer-types (#10527)
* ext/opcache/zend_jit: cast function to fix -Wincompatible-pointer-types

Regression by commit a21195650e

* TSRM/win32: fix ts_allocate_dtor cast

The dtor was casted to ts_allocate_ctor; luckily, ts_allocate_dtor and
ts_allocate_ctor just happen to be the same type.
2023-02-07 13:38:17 +03:00
Dmitry Stogov a21195650e Fix possible exit_counters memory leak in ZTS build 2023-02-06 18:35:06 +03:00
Niels Dossche 49551d7c29 Sync boost/context assembly files for fibers
Fixes GH-10398

The stack was misaligned upon entering the trampoline function [1], this
causes a CPU trap when the SSE instruction is executed to copy data from
the stack. This was fixed upstream [2]. This commit syncs all upstream
changes from the boost/context assembly files to our copy.

[1] https://github.com/php/php-src/pull/10407#issuecomment-1404180877
[2] https://github.com/boostorg/context/pull/219

Closes GH-10407.
2023-02-05 16:40:54 +00:00
Niels Dossche 5b13e83074 Fix GH-10385: FPM successful config test early exit
This introduces an enum `fpm_init_return_status` to propagate the status
up to fpm_main. This also makes the code clearer by not using magic
integer return numbers.

Closes GH-10388
2023-02-05 13:07:29 +00:00
Jakub Zelenka 4199b72c50 Fix GH-10315: FPM unknown child alert not valid
This changes the log level for an unknown child during wait as this is
not unuasual if FPM master has pid 1 and also possible in some cases
for higher pid processes. Based on that and the fact that this is not
really a problem, there is just a debug level message emitted for pid 1
and for higher pid a warning is emitted.

Closes GH-10319
2023-02-05 12:36:02 +00:00
Tyson Andre fe2dc2b481 Avoid crash for reset/end/next/prev() on ffi classes (#9711)
(And any PECLs returning `zend_empty_array` in the handler->get_properties
overrides)

Closes GH-9697

This is similar to the fix used in d9651a9419
for array_walk.

This should make it safer for php-src (and PECLs, long-term) to return
the empty immutable array in `handler->get_properties` to avoid wasting memory.
See https://github.com/php/php-src/issues/9697#issuecomment-1273613175

The only possible internal iterator position for the empty array is at the end
of the empty array (nInternalPointer=0).
The `zend_hash*del*` helpers will always set nInternalPointer to 0 when an
array becomes empty,
regardless of previous insertions/deletions/updates to the array.
2023-02-03 09:17:33 -05:00
Max Kellermann f7e678476f .github/workflows/push.yml: enable ccache
This reduces the LINUX_X64_RELEASE_ZTS build time from 9-10 minutes to
less than 3 minutes.

Closes GH-10395
2023-02-02 18:58:30 +01:00