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

58302 Commits

Author SHA1 Message Date
Levi Morrison
fa78e17724 Stop closing stderr and stdout streams (#8569)
Extensions may (and do) write to stderr in mshutdown and similar. In
the best case, with the stderr stream closed, it's just swallowed.

However, some libraries will do things like try to detect color, and
these will outright fail and cause an error path to be taken.
2022-05-20 13:27:23 +02:00
robertnisipeanu
8735ae9d13 Fix GH-8578: Error on wrong parameter on SoapHeader constructor
Closes GH-8579.
2022-05-19 11:03:49 +02:00
Dmitry Stogov
84ea0aa684 Fix memory leak
This fixes oss-fuzz #47448
2022-05-16 13:45:31 +03:00
Dmitry Stogov
05375602a7 Fix type inference
This fixes oss-fuzz #47422
2022-05-16 12:41:25 +03:00
Arnaud Le Blanc
33b8ef9958 Do not optimize out ini_get() when the entry does not exist during compilation (#8507)
The entry may exist later if dl is enabled

Fixes GH-8466
2022-05-13 12:39:29 +02:00
Dmitry Stogov
3f1e1b9ddf Fix type inference
This fixes oss-fuzz #47049
2022-05-11 12:09:11 +03:00
Christoph M. Becker
a7a590211e Fix mysqli tests wrt. MySQL 8.0.28
As of MySQL 8.0.28, `utf8mb3` charset is reported by the server, but
mysqlnd doesn't support it yet.  As a stop-gap measure, we ignore that
charset for now.

Closes GH-8480.
2022-05-09 10:55:32 +02:00
Derick Rethans
92f8f19d50 Fixed GH-8471: Segmentation fault when converting immutable and mutable DateTime instances created using reflection 2022-05-05 12:10:50 +01:00
Christoph M. Becker
710294c9a5 Fix zend_test tests
The `--EXTENSIONS--` directive isn't properly supported prior to PHP
8.1.0, so we use the classic `--SKIPIF--` instead.
2022-05-04 11:29:08 +02:00
vajexal
74924ada93 Fix get_function_or_method_name when included file is scoped (#8467) 2022-05-03 21:34:01 +02:00
Christoph M. Becker
722e9b9fa5 Fix test for curl 7.83.0
libcurl 7.83.0 removed some trailing exclamation marks from error
messages[1]; we have to cater to that.

[1] <6968fb9d54>

(cherry picked from commit a4179e4c92)
2022-05-03 15:07:50 +02:00
Christoph M. Becker
ad7b9f4e50 Fix GH-8235: iterator_count() may run indefinitely
We need to prevent integer overflow to eventually stop the iteration.

A test case doesn't appear sensible for this, because even on 32bit
architectures a respective test easily runs for a few minutes.

Closes GH-8447.
2022-05-03 12:57:58 +02:00
Michael Voříšek
136ef6f129 Fix PDO URI test
Especially for remote servers, the respective part of the test may fail
for a lot of different reasons; instead of trying to catch all, we
rewrite to not fail, still testing for the contained NUL byte.

Closes GH-8451.
2022-05-03 12:12:41 +02:00
Martin Rehberger
389d11308c bug: Fix type for $index in ZipArchive::replaceFile 2022-05-02 14:08:19 +02:00
Michael Voříšek
60487621c1 Fix test XFAIL, update phar to use spl_autoload_register
Closes GH-8449.
2022-05-02 13:58:25 +02:00
Derick Rethans
b461c4673b Use the new RETURN_THROWS() instead of just returning NULL 2022-04-26 17:57:47 +01:00
Derick Rethans
87f341b1c2 Return early when the timezone info is NULL.
The guess_timezone function does throw an error, but throwing an error doesn't
immediate make the PHP_FUNCTION return.

This check is really only necessary for distributions that patch PHP's timelib
to use system tzdata, but not correct enough to account for their
implementation to guarantee to return a timezone.
2022-04-26 16:43:30 +01:00
Dmitry Stogov
3564eaff42 Fixed tests 2022-04-26 08:31:42 +03:00
Christoph M. Becker
30f4c725cb Fix GH-8218: ob_end_clean does not reset Content-Encoding header
The fix for GH-7953 introduced a regression by being to deliberate
adding the respective headers.  These must only be added, if the
handler starts, but is not finalizing.

Closes GH-8353.
2022-04-25 14:26:56 +02:00
Dmitry Stogov
3b735456c6 Reorder optimization passes to avoid miss-optimization 2022-04-25 13:09:05 +03:00
Dmitry Stogov
3e78964742 Fix type inference
Use MAY_BE_NULL result (insted of empty) for ASSIGN_DIM with invalid arguments
This fixes oss-fuzz #46840
2022-04-25 12:15:55 +03:00
Dmitry Stogov
8286de2fd3 Fix type narrowing warning during type inference of ZEND_FETCH_DIM_W
Fixes oss-fuzz #45820
2022-04-25 11:16:10 +03:00
Bob Weinand
a74b865123 Add missing SKIPIF for new ext/ffi test 2022-04-24 18:02:46 +02:00
Bob Weinand
2397e7685e Fix GH-8433: Assigning function pointers to structs in FFI leaks memory 2022-04-24 14:53:18 +02:00
Christoph M. Becker
f5d9e7c031 Fix GH-8364: msgfmt_format $values may not support references
We need to deref any references passed in the `$values` array.  While
we could handle this in the type switch, doing it right away in the
foreach loop makes that more explicit, and also circumvents the missing
range checks for integers which are not passed as int or double.

Closes GH-8407.
2022-04-24 12:43:08 +02:00
George Peter Banyard
6186ecd436 Fix GH-8273: SplFileObject: key() returns wrong value 2022-04-23 13:56:38 +01:00
Ollie Read
d0f1b987a5 Fix GH-8421: Attributes that target functions are not valid for anonymous functions defined within a method
Closes GH-8424
2022-04-23 11:16:28 +02:00
Derick Rethans
c854bb2472 Fixed GH-8400: bug73837.phpt makes no sense
Replaces the indeed silly test with something that actually does the job,
albeit much slower.
2022-04-22 10:29:37 +01:00
Michael Voříšek
36de002cc6 Verify generated files are up to date in CI
Closes GH-8295
2022-04-21 23:25:47 +02:00
Christoph M. Becker
dad5cb442d Fix GH-8408: bug68547.phpt fails without multibyte support 2022-04-20 16:42:09 +02:00
Nikita Popov
d16d251e20 Move MAY_BE_REF check into COPY_SSA_OBJ_TYPE
ZEND_ASSIGN is not the only place where this is relevant, so
handle it generically inside COPY_SSA_OBJ_TYPE instead.
2022-04-15 23:14:04 +02:00
Nikita Popov
5d072578cd Don't use CE for by-ref arguments 2022-04-15 23:00:43 +02:00
Nikita Popov
41f33b9dc3 Don't use CE info from pi node for MAY_BE_REF var
Once again, the actual class type may be reassigned indirectly.
2022-04-15 22:36:13 +02:00
Nikita Popov
b08aac0451 Fix inference for assignment of known object to reference
We cannot retain the ce information in that case, we have to
assume the ce may change indirectly through the reference.

Fixes oss-fuzz #46720.
2022-04-15 22:14:44 +02:00
Christoph M. Becker
1762a87932 Fix GH-8366: ArrayIterator may leak when calling __construct()
When we detach an iterator, we also have to delete it.

Closes GH-8374.
2022-04-15 19:05:18 +02:00
Derick Rethans
e38d300a70 Refactor code to avoid duplication 2022-04-14 10:32:10 +01:00
Cody Mann
24085d0192 style/readability updates 2022-04-14 10:22:00 +01:00
Cody Mann
287c8a86b4 GH-7979: iterator advances when checking if valid 2022-04-14 10:22:00 +01:00
Mikko Pesari
16bf8331e0 Fix openssl_csr_export() stub
Closes GH-8362.
2022-04-13 15:20:58 +02:00
Tim Düsterhus
5655f1abe3 Fix --EXTENSIONS-- section for two tests in ext/zend_test
The extension name got broken in e6cf583160.

Closes GH-8357.
2022-04-13 14:45:52 +02:00
Bernd Holzmüller
84c18f9f04 Preserve file-position when php://temp switches to temporary file
Closes GH-8333.
2022-04-11 12:31:22 +02:00
Dmitry Stogov
3aaf2f6f89 JIT: Fix memory lek
Fixes oss-fuzz #46462
2022-04-11 12:17:05 +03:00
Dmitry Stogov
5b048dd05c Tracing JIT: Fixed incorrect assumption about stack slot type
Fixes oss-fuzz #46404
2022-04-11 11:42:01 +03:00
Christoph M. Becker
7c702b72f2 Fix GH-8267: MySQLi uses unsupported format specifier on Windows
Instead of using the unsupported `%I64u` and `%I64d` format specifiers
on Windows, we use the portable `PRIu64` and `PRId64` specifiers.

The `L64()` macro and the `my_longlong` typedef should be adapted as
well, as the `i64` literal suffix is still supported by MSVC, but using
`LL` or `ll` is recommended[1], and the standard `int64_t` is available
there anyway.  This is not urgent, though.

[1] <https://docs.microsoft.com/en-us/cpp/cpp/numeric-boolean-and-pointer-literals-cpp?view=msvc-170#integer-literals>

Closes GH-8268.
2022-04-07 17:03:15 +02:00
Derick Rethans
7aefee1613 Updated to version 2022.1 (2022a) 2022-04-07 10:45:19 +01:00
Christoph M. Becker
c2eafc29f5 Fix #81714: segfault when serializing finalized HashContext
We must not allow to serialize already finalized `HashContext`s, since
the internal context is already freed.  Since there is not much point
in serializing finalized `HashContext`s, we just bail out in that case.

Closes GH-8265.
2022-04-05 13:25:22 +02:00
Dmitry Stogov
c489e360a6 JIT: Fix array clobbering by user error handler
Fixes oss-fuzz #46336
2022-04-04 16:36:25 +03:00
Dmitry Stogov
c0bb238483 Fixed reference counting inference
Fixes oss-fuzz #46084
2022-04-04 15:34:02 +03:00
Dmitry Stogov
0d44bbd212 JIT: Fixed incorrect code generation
Fixes oss-fuzz #46328
2022-04-04 14:20:45 +03:00
Kamil Tekiela
06e383b2f4 Fix regression from #8058
Closes GH-8181
2022-03-31 10:31:52 +01:00