Commit graph

63308 commits

Author SHA1 Message Date
nielsdos
7300659391 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Set error_log to an empty value if the test relies on that feature
2023-04-24 23:23:45 +02:00
Niels Dossche
691ff9f845 Set error_log to an empty value if the test relies on that feature
Some tests fail if the error_log is overriden by the loaded ini
configuration. Explicitly set it to an empty value to prevent the
failures.
See https://github.com/php/php-src/issues/10737#issuecomment-1452899299

Closes GH-10772.
2023-04-24 23:19:15 +02:00
Derick Rethans
629d7740e8 Import timelib 2022.07 to address OSS fuzz issue 2023-04-21 11:29:56 +01:00
Ilija Tovilo
b2282bee32
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix reference returned from CallbackFilterIterator::accept()
2023-04-20 13:43:20 +02:00
Ilija Tovilo
5855bdcd6c
Fix reference returned from CallbackFilterIterator::accept()
Fixes oss-fuzz #58181
2023-04-20 10:18:18 +02:00
Christopher Jones
91d3aaaa93
Bump OCI8 version to make a PECL release for 8.2 2023-04-20 18:01:43 +10:00
Ilija Tovilo
72fc8b51a4
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix mysql tests with non-standard server port
2023-04-20 08:45:52 +02:00
Michael Voříšek
0ab51a9561
Fix mysql tests with non-standard server port
Closes GH-9744
2023-04-20 08:45:14 +02:00
Ilija Tovilo
f948f79696
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [skip ci] Add all conflict to curl
2023-04-19 16:24:16 +02:00
Ilija Tovilo
af6b413691
[skip ci] Add all conflict to curl 2023-04-19 16:23:52 +02:00
Derick Rethans
cc7b799c44 Fixed tests 2023-04-18 13:46:07 +01:00
Derick Rethans
44eef677b0 Import timelib 2022.06 2023-04-18 13:46:07 +01:00
Remi Collet
f5dc2c31d9
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-11071: Revert "Fix [-Wundef] warning in INTL extension"
2023-04-18 11:04:54 +02:00
Remi Collet
31e21f7dbc
Fix GH-11071: Revert "Fix [-Wundef] warning in INTL extension"
This reverts commit ea8686540a.
2023-04-18 11:04:28 +02:00
Ilija Tovilo
35c1bb2e47
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Support enums in array_unique
2023-04-16 15:35:55 +02:00
Ilija Tovilo
e8b8341d3d
Support enums in array_unique
Fixes GH-9775
Closes GH-11015
2023-04-16 15:34:56 +02:00
Jakub Zelenka
6d33a1ab70
Merge branch 'PHP-8.1' into PHP-8.2 2023-04-16 10:55:02 +01:00
Jakub Zelenka
84be9042f9
Add missing zend_test_crash message initialization 2023-04-16 10:54:39 +01:00
Jakub Zelenka
9a20f43b94
Merge branch 'PHP-8.1' into PHP-8.2 2023-04-15 21:29:11 +01:00
Jakub Zelenka
0ac55e9bfb
Add zend_test_crash funtion to segfault PHP process
This is useful for testing PHP-FPM handling of crashed children.

Closes GH-11082
2023-04-15 21:25:02 +01:00
Ilija Tovilo
023e17a89d
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [skip ci] Skip bug45161.phpt on Windows
2023-04-13 13:20:45 +02:00
Ilija Tovilo
4b22c3e3ad
[skip ci] Skip bug45161.phpt on Windows
See GH-10753

The test is insanely slow on Windows and it's unclear why. It might be a curl
issue.
2023-04-13 13:19:52 +02:00
Ilija Tovilo
de9ea68ad8
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix test bug60120.phpt
2023-04-13 12:57:10 +02:00
Ilija Tovilo
dd44a9330e
Fix test bug60120.phpt
The process cmd was broken. We're now also checking that the process output is
actually what we expect.

Closes GH-11064
2023-04-13 12:56:18 +02:00
Derick Rethans
d3f82f30b7 Merge branch 'PHP-8.1' into PHP-8.2 2023-04-12 11:39:02 +01:00
Derick Rethans
884eb4bba6 Merge remote-tracking branch 'derickr/fixed-broken-date-time-tests' into PHP-8.1 2023-04-12 11:36:39 +01:00
Dmitry Stogov
e14ac1caee Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Allow FETCH_OBJ_W and FETCH_STATIC_PROP_W to return INDIRECT/UNDEF zval for uninitialized typed properties (#11048)
2023-04-10 23:25:08 +03:00
Dmitry Stogov
0c65b396d6
Allow FETCH_OBJ_W and FETCH_STATIC_PROP_W to return INDIRECT/UNDEF zval for uninitialized typed properties (#11048) 2023-04-10 23:19:17 +03:00
Derick Rethans
e67bb14ab4 Fixed tests and remove the XFAIL 'Various bugs exist'. They did, but they were in the tests 2023-04-07 23:50:55 +01:00
Niels Dossche
2d2cf3b6e0 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-9397: exif read : warnings and errors : Potentially invalid endianess, Illegal IFD size and Undefined index
2023-04-05 21:37:48 +02:00
Niels Dossche
b81ce297a1 Fix GH-9397: exif read : warnings and errors : Potentially invalid endianess, Illegal IFD size and Undefined index
Don't misinterpret DJI info maker note as DJI maker note.

The DJI and DJI info maker note both share the "DJI" make string.
This caused the current code to try to interpret the DJI info maker note
as a DJI maker note. However, the DJI info maker note requires custom
parsing. Therefore, the misinterpretation actually caused the current
code to believe that there was an unrecoverable error in the IFD for the
maker note by returning false in the maker note parser. This in turn
caused the inability to parse other EXIF metadata.

This patch adds the identification of the DJI info maker note so that it
cannot be misinterpreted. Since we don't implement custom parsing, it
achieves this by setting the tag list to a special marker value (in this
case the NULL pointer). When this marker value is detected, the function
will just skip parsing the maker note and return true. Therefore, the
other code will believe that the IFD is not corrupt.

This approach is similar to handing an unrecognised maker note type
(see the loop on top of exif_process_IFD_in_MAKERNOTE() which also
returns true and treats it as a string). The end result of this patch
is that the DJI info maker note is considered as unknown to the caller of
exif_process_IFD_in_MAKERNOTE(), and therefore that the other EXIF
metadata can be parsed successfully.

Also fix debug output typos in exif.

Closes GH-10470.
2023-04-05 21:35:19 +02:00
Niels Dossche
94a00e9ecd Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix incorrect error handling in dom_zvals_to_fragment()
2023-04-03 21:24:58 +02:00
Niels Dossche
0579beb842 Fix incorrect error handling in dom_zvals_to_fragment()
Discovered this pre-existing problem while testing GH-10682.
Note: this problem existed *before* that PR.

* Not all paths throw a hierarchy request error
* xmlFreeNode must be used instead of xmlFree for the fragment to also
  free its children.
* Free up nodes that couldn't be added when xmlAddChild fails.

I unified the error handling code that's exactly the same with a goto to
prevent at least some of such problems in the future.

Closes GH-10981.
2023-04-03 21:21:35 +02:00
Dmitry Stogov
962aac698e Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Tracing JIT: Fixed incorrect code generation fofr SEND-ing of result of ASSIGN to typed reference
2023-04-03 18:15:46 +03:00
Dmitry Stogov
8a749c79d0 Tracing JIT: Fixed incorrect code generation fofr SEND-ing of result of ASSIGN to typed reference 2023-04-03 18:15:41 +03:00
Niels Dossche
dd29b66dfa Fix GH-10983: State-dependant segfault in ReflectionObject::getProperties
This is a variant of GH-10200, but in a different place.
Basically, simplexml may create a properties table that's packed instead
of associative. But the macro that was used to loop over the properties
table assumed that it was always associative. Replace it by the macro
that figures it out automatically which one of the two it is.

For test: Co-authored-by: jnvsor

Closes GH-10984.
2023-04-01 20:19:14 +02:00
Niels Dossche
0d12b3db64 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-10990: mail() throws TypeError after iterating over $additional_headers array by reference
  Fix GH-8841: php-cli core dump calling a badly formed function
2023-04-01 20:04:48 +02:00
Niels Dossche
79c5b32d15 Fix GH-10990: mail() throws TypeError after iterating over $additional_headers array by reference
We should dereference the values, otherwise references don't work.

Closes GH-10991.
2023-04-01 19:44:43 +02:00
Ilija Tovilo
d1fc88c726
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix incorrect zval type_flags in preg_replace_callback_array() for immutable arrays
2023-03-31 14:42:35 +02:00
Ilija Tovilo
66ce205718
Fix incorrect zval type_flags in preg_replace_callback_array() for immutable arrays
The ZVAL_ARR macro always set the zval type_info to IS_ARRAY_EX, even if the
hash table is immutable. Since in preg_replace_callback_array() we can return
the passed array directly, and that passed array can be immutable, we need to
reset the type_flags to keep the VM from performing ref-counting on the array.

Fixes GH-10968
Closes GH-10970
2023-03-31 14:41:41 +02:00
Niels Dossche
47b3fe4710 Handle indirect zvals and use up-to-date properties in SplFixedArray::__serialize
Closes GH-10925.
2023-03-30 21:43:39 +02:00
Niels Dossche
4b3eb0b048 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix bug #80602: Segfault when using DOMChildNode::before()
2023-03-30 20:50:23 +02:00
NathanFreeman
2d6decc14c Fix bug #80602: Segfault when using DOMChildNode::before()
This furthermore fixes the logic error explained in
https://github.com/php/php-src/pull/8729#issuecomment-1161737132

Closes GH-10682.
2023-03-30 20:49:05 +02:00
Jakub Zelenka
e80073d3d2
Fix GH-10406: feof() behavior change for UNIX based socket resources
This change restores the old behaviour for the server socket streams
that don't support IO. This is now stored in the stream flags so it can
be later used to do some other decisions and possibly introduce some
better error reporting.

Closes GH-10877
2023-03-30 13:31:46 +01:00
Niels Dossche
8a1cbdd7df Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix uninitialized variable accesses in sockets/conversions
2023-03-29 19:47:38 +02:00
Niels Dossche
b8755a7559 Fix uninitialized variable accesses in sockets/conversions
This was first pointed out in GH-10959.
The from_zval_... functions don't always write to the pointer, in particular
it is necessary to check for an error before using the value. Otherwise
we can access an uninitialized value and that's UB (and dangerous).

Note: this does *NOT* get rid of the compiler warning. Even though there
is error checking now, the compiler isn't smart enough to figure out
that the values can not be used uninitialized.

Closes GH-10966.
2023-03-29 19:44:30 +02:00
Derick Rethans
3ec02202fd Updated to version 2023.3 (2023c) 2023-03-29 10:06:01 +01:00
Derick Rethans
bb7dd51f7a Updated to version 2023.3 (2023c) 2023-03-29 10:06:00 +01:00
Niels Dossche
e9195b21cc Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix undefined behaviour in unpack()
2023-03-28 22:43:53 +02:00
Niels Dossche
87862835e2 Fix undefined behaviour in unpack()
atoi()'s return value is actually undefined when an underflow or
overflow occurs. For example on 32-bit on my system the overflow test
which inputs "h2147483648" results in repetitions==2147483647 and on
64-bit this gives repetitions==-2147483648. The reason the test works on
32-bit is because there's a second undefined behaviour problem:
in case 'h' when repetitions==2147483647, we add 1 and divide by 2.
This is signed-wrap undefined behaviour and accidentally triggers the
overflow check like we wanted to.

Avoid all this trouble and use strtol with explicit error checking.

This also fixes a semantic bug where repetitions==INT_MAX would result
in the overflow check to trigger, even though there is no overflow.

Closes GH-10943.
2023-03-28 22:43:27 +02:00