1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 10:43:30 +02:00
Commit Graph

131417 Commits

Author SHA1 Message Date
George Peter Banyard 382148d7bb Fix UBSAN warning about applying zero offset to null pointer (#10700)
vpath may be NULL here so check for it before trying to add 0 (the length of the vpath) to it.
2023-02-26 14:06:30 +00:00
Niels Dossche 375e7402af Change implicit enum return value checks to explicit checks (#10703) 2023-02-26 08:56:20 +00:00
Niels Dossche f0cfebc2b8 Use zend_result where appropriate in ext/openssl
Remove dead code

s is always NULL, so the check is always false.

Closes GH-10704.
2023-02-26 08:28:23 +00:00
David Carlier c54948378d Merge branch 'PHP-8.2' 2023-02-26 08:19:05 +00:00
David Carlier bf2e778c71 Merge branch 'PHP-8.1' into PHP-8.2 2023-02-26 08:18:09 +00:00
Niels Dossche b09be29ac1 Fix incorrect error checking in php_openssl_set_server_dh_param()
SSL_CTX_set_tmp_dh() and SSL_CTX_set0_tmp_dh_pkey() return 1 on success
and 0 on error. But only < 0 was checked which means that errors were
never caught.

Closes GH-10705.
2023-02-26 08:17:14 +00:00
Niels Dossche eb7bb3430b Fix format string mistake in accel_move_code_to_huge_pages()
inode is unsigned, so use %lu instead of %ld
2023-02-26 08:12:57 +00:00
othercorey e1967ca9ed Change DOMCharacterData::appendData return type to true (#10690) 2023-02-25 21:42:10 +00:00
George Peter Banyard 7c44baa334 [skip ci] Add comments as to why no ZPP union type format is used 2023-02-25 17:16:03 +00:00
David Carlier 0c0b41d875 Merge branch 'PHP-8.2' 2023-02-25 14:36:56 +00:00
David Carlier 7638640529 Fix GH-10659: hash/xxhash applying build upstream fix
ref: https://github.com/Cyan4973/xxHash/commit/6189ecd3d44a693460f86280ccf49d33cb4b18e1

replacing the C++ compile time assert for C11 one.

Closes GH-10693.
2023-02-25 14:36:35 +00:00
David Carlier a890b0ba73 Merge branch 'PHP-8.2' 2023-02-25 14:33:59 +00:00
David Carlier bf68d10bb4 Merge branch 'PHP-8.1' into PHP-8.2 2023-02-25 14:33:11 +00:00
Niels Dossche df579adac7 Fix GH-10692: PHP crashes on Windows when an inexistent filename is executed
Fixes GH-10692

php_fopen_primary_script() does not initialize all fields of
zend_file_handle. So when it fails and when fastcgi is true, the
zend_destroy_file_handle() function will try to free uninitialized
pointers, causing a segmentation fault. Fix it by zero-initializing file
handles just like the zend_stream_init_fp() counterpart does.

Closes GH-10697.
2023-02-25 14:32:55 +00:00
Niels Dossche dcc3255b18 Fix GH-10489: run-tests.php does not escape path when building cmd (#10560)
Multiple tests had to be changed to escape the arguments in shell
commands. Some tests are skipped because they behave differently with
spaces in the path versus without. One notable example of this is the
hashbang test which does not work because spaces in hashbangs paths are
not supported in Linux.

Co-authored-by: Michael Voříšek <mvorisek@mvorisek.cz>
2023-02-25 14:02:06 +00:00
Ilija Tovilo b14785ca85 Merge branch 'PHP-8.2'
* PHP-8.2:
  [skip ci] Add github reference to bug fix in NEWS
2023-02-24 20:46:11 +01:00
Ilija Tovilo c9bd540bac Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [skip ci] Add github reference to bug fix in NEWS
2023-02-24 20:45:31 +01:00
Ilija Tovilo 7d2b01eea7 [skip ci] Add github reference to bug fix in NEWS 2023-02-24 20:44:47 +01:00
Ilija Tovilo 3a602d235c Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix GH-10570: Assertion `(key)->h != 0 && "Hash must be known"' failed.
2023-02-24 20:42:00 +01:00
Ilija Tovilo 9b10b65e2b Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-10570: Assertion `(key)->h != 0 && "Hash must be known"' failed.
2023-02-24 20:41:40 +01:00
Niels Dossche b9a5bfc355 Fix GH-10570: Assertion `(key)->h != 0 && "Hash must be known"' failed.
Fixes GH-10570, see GH-10570 for analysis.

Closes GH-10572
2023-02-24 20:40:29 +01:00
David Carlier ad7d3c888d Merge branch 'PHP-8.2' 2023-02-24 17:03:50 +00:00
David Carlier 9cac68d678 Merge branch 'PHP-8.1' into PHP-8.2 2023-02-24 17:03:00 +00:00
nielsdos 8959ff39d8 Fix incorrect type for return value of zend_update_static_property_ex()
zend_update_static_property_ex() returns a zend_result, but the return
value is stored here in a bool. A bool is unsigned on my system, so in
case zend_update_static_property_ex() returns FAILURE (== -1) this gets
converted to 1 instead. This is not a valid zend_result value. This
means that (transitive) callers could mistakingly think the function
succeeded while it did in fact not succeed. Fix it by changing the type
to zend_result.

Closes GH-10691.
2023-02-24 17:02:32 +00:00
George Peter Banyard 51b70e4414 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fixed bug GH-10270 Unable to return CURL_READFUNC_PAUSE in readfunc callback
  Fix GH-10672 (pg_lo_open segfaults in the strict_types mode)
2023-02-24 14:33:47 +00:00
George Peter Banyard 512abc23a4 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fixed bug GH-10270 Unable to return CURL_READFUNC_PAUSE in readfunc callback
  Fix GH-10672 (pg_lo_open segfaults in the strict_types mode)
2023-02-24 14:33:28 +00:00
Pierrick Charron 91db3a1b85 Fixed bug GH-10270 Unable to return CURL_READFUNC_PAUSE in readfunc callback
Closes GH-10607

Signed-off-by: George Peter Banyard <girgias@php.net>
2023-02-24 14:32:23 +00:00
George Peter Banyard 5f357f341d Fix GH-10672 (pg_lo_open segfaults in the strict_types mode)
We need to use the proper ZPP qualifier for zend_string

Closes GH-10677
2023-02-24 14:31:23 +00:00
Tim Düsterhus f079aa2e24 random: Fix return type of php_random_(bytes|int) (#10687)
These return a `zend_result`, not `int`.
2023-02-24 15:10:44 +01:00
Max Kellermann e9c8621632 ext/opcache/zend_shared_alloc: use memfd for locking if available
A memfd is a virtual file that has no reachable path, therefore does
not clobber any filesystem.  It is deleted automatically as soon as
the last handle gets closed.  The feature is available since Linux
kernel 3.17.

Closes GH-10589.
2023-02-23 22:34:35 +00:00
Ilija Tovilo ab99072608 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix segfault when using ReflectionFiber (fixes #10439)
2023-02-23 23:28:31 +01:00
Ilija Tovilo f1818d726f Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix segfault when using ReflectionFiber (fixes #10439)
2023-02-23 23:27:55 +01:00
Daniil Gentili 8d1c0a1403 Fix segfault when using ReflectionFiber (fixes #10439)
Closes GH-10478
2023-02-23 23:20:27 +01:00
Ilija Tovilo 5c84e0a576 Merge branch 'PHP-8.2'
* PHP-8.2:
  Re-enable UnixODBC testing.
2023-02-23 23:14:43 +01:00
Ilija Tovilo c891495e04 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Re-enable UnixODBC testing.
2023-02-23 23:14:34 +01:00
Danack 939c546ea1 Re-enable UnixODBC testing.
The problem installing the package in the CI environment has been fixed.
2023-02-23 23:14:02 +01:00
Niels Dossche 91857ccaf9 Use an explicit failure check for zend_result functions in the scanner (#10688) 2023-02-23 22:56:07 +01:00
David Carlier 1c62c60c94 Merge branch 'PHP-8.2' 2023-02-23 18:49:19 +00:00
David Carlier bb2177e248 Merge branch 'PHP-8.1' into PHP-8.2 2023-02-23 18:48:25 +00:00
Niels Dossche c510083c8c Fix incorrect string length for output_handler in zlib ini code
The length of "output_handler" is supposed to be passed, but as sizeof
is used, the resulting number includes the NUL character, so the length
is off-by-one. Subtract one to pass the correct length.

Closes GH-10667.
2023-02-23 18:47:26 +00:00
Tim Düsterhus b14dd85dca random: Move the CSPRNG implementation into a separate C file (#10668)
The CSPRNG is a delicate and security relevant piece of code and having it in
the giant random.c makes it much harder to verify changes to it. Split it into
a separate file.
2023-02-23 19:17:09 +01:00
Max Kellermann d5c649b36b zend_compiler, ...: use uint8_t instead of zend_uchar (#10621)
`zend_uchar` suggests that the value is an ASCII character, but here,
it's about very small integers.  This is misleading, so let's use a
C99 integer instead.

On all architectures currently supported by PHP, `zend_uchar` and
`uint8_t` are identical.  This change is only about code readability.
2023-02-23 14:56:54 +00:00
Max Kellermann 0460420205 Zend/zend_variables: use C99 designated initializers (#10655)
This change allows to potentially turn the ``IS_`` macros into an enum with automatic values.
2023-02-23 14:46:31 +00:00
Máté Kocsis 101178214c Declare proper parameter default values for imagegd2 (#10569) 2023-02-23 10:54:55 +01:00
Máté Kocsis a981ad7ad2 Merge branch 'PHP-8.2'
* PHP-8.2:
  Add support for generating namespaced constant
2023-02-23 10:49:40 +01:00
SATO Kentaro 7fccdf72a4 Add support for generating namespaced constant
Closes GH-10552
2023-02-23 10:05:30 +01:00
Alex Dowad 8995f60258 mb_decode_mimeheader obeys RFC 2047 regarding underscores and QPrint encoding 2023-02-22 23:19:57 +02:00
Alex Dowad 157ca654f2 Implement mb_decode_mimeheader using fast text conversion filters
The new implementation is 2.5x-3x faster.

If an invalid charset name was used, the old implementation would get
'stuck' trying to parse the charset name and would not interpret any
other MIME encoded words up to the end of the input string. The new
implementation fixes this bug.

If an (invalid) encoded word ends abruptly and a new (valid) encoded
word starts, the old implementation would not decode the valid encoded
word. The new implementation also fixes this.

Otherwise, the behavior of the new implementation has been designed to
closely match that of the old implementation.
2023-02-22 23:08:03 +02:00
Alex Dowad 117f2263ce Remove unneeded function mbfl_no2preferred_mime_name 2023-02-22 23:08:03 +02:00
Alex Dowad a85adb170c Remove unneeded function mbfl_name2no_encoding 2023-02-22 23:08:03 +02:00