1
0
mirror of https://github.com/php/php-src.git synced 2026-04-14 11:32:11 +02:00
Commit Graph

129192 Commits

Author SHA1 Message Date
Ilija Tovilo
966d22b1bd Fix property fetch on magic constants in constant expressions
Closes GH-9136
Closes GH-9138
Closes GH-9172
2022-07-28 14:14:11 +02:00
Bob Weinand
b576bb901e Avoid using a stack allocated zend_function in Closure::call, to avoid prevent crashes on bailout
Having a stack allocated zend_function may cause crashes if the stack is polluted between bailout and the actual unwinding in zend_observer_fcall_end_all.

Signed-off-by: Bob Weinand <bobwei9@hotmail.com>
2022-07-28 13:04:11 +02:00
Derick Rethans
63798e5d99 Merge branch 'PHP-8.1' 2022-07-28 11:50:10 +01:00
Derick Rethans
566f902ca7 Merge branch 'PHP-8.0' into PHP-8.1 2022-07-28 11:50:02 +01:00
Derick Rethans
4147257fc4 Merge remote-tracking branch 'derickr/bug80047-take2' into PHP-8.0 2022-07-28 11:49:47 +01:00
Derick Rethans
534127d3b2 Merge branch 'PHP-8.1' 2022-07-28 11:49:00 +01:00
Derick Rethans
b0d67aa605 Merge remote-tracking branch 'derickr/bug80047-take2' into PHP-8.1 2022-07-28 11:48:30 +01:00
Jakub Zelenka
1a9e6895f1 Fix #65069: GlobIterator incorrect handling of open_basedir check
This PR changes the glob stream wrapper so it impacts "glob://"
streamsas well. The idea is to do a check for each found path instead
of the pattern which was not working correctly.
2022-07-28 11:42:42 +01:00
Derick Rethans
001e7dbb04 Fixed bug #80047 (DatePeriod doesn't warn with custom DateTimeImmutable) 2022-07-28 10:28:10 +01:00
Derick Rethans
85f3a969dc Revert "Fixed #80047: DatePeriod doesn't warn with custom DateTimeImmutable"
This reverts commit 973c3f6e24.
2022-07-28 10:13:54 +01:00
jcm
520bb2ec6c Fix get/set priority - error handling for MacOS and extra tests
Closes GH-9044.
2022-07-27 13:53:42 +02:00
Christoph M. Becker
a398a2fd3d Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix GH-9032: SQLite3 authorizer crashes on NULL values
2022-07-27 13:11:58 +02:00
Christoph M. Becker
ca84d06bbc Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-9032: SQLite3 authorizer crashes on NULL values
2022-07-27 13:06:15 +02:00
Christoph M. Becker
8ed21a89f3 Fix GH-9032: SQLite3 authorizer crashes on NULL values
The arguments 3 to 6 of the authorizer callback may be `NULL`[1], and
we have to properly deal with that.  Instead of causing a segfault, we
deny authorization, which is still better than a crash, and apparently,
we cannot do better anyway.

[1] <https://www.sqlite.org/c3ref/set_authorizer.html>

Closes GH-9040.
2022-07-27 12:49:16 +02:00
Christoph M. Becker
89216b23dd Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix GH-9155: dba_open("non-existing", "c-", "flatfile") segfaults
2022-07-27 12:16:25 +02:00
Christoph M. Becker
cf1664e91d Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-9155: dba_open("non-existing", "c-", "flatfile") segfaults
2022-07-27 12:13:32 +02:00
Christoph M. Becker
a442e29485 Fix GH-9155: dba_open("non-existing", "c-", "flatfile") segfaults
We must not assume that the lock file has been opened.

Closes GH-9156.
2022-07-27 12:08:36 +02:00
Christoph M. Becker
5d62cfbc7d Tweak openssl_random_pseudo_bytes() upper bound error message
As suggested by @guilliamxavier.
2022-07-27 11:43:25 +02:00
Adam Saponara
8cf9c2f200 Fix GH-9090: Support assigning function pointers in FFI
Closes GH-9107.
2022-07-27 10:42:25 +02:00
David CARLIER
099b16800c GH-9157: opcache fix build on older macOs releases.
Closes #9158.
2022-07-27 09:37:54 +01:00
Tim Düsterhus
d058acb4ac Use ValueError if an invalid mode is passed to Mt19937 (#9159) 2022-07-27 09:03:02 +02:00
Máté Kocsis
eae893bd3e Declare ext/pgsql constants in stubs (#9092) 2022-07-27 07:32:40 +02:00
Máté Kocsis
1362fefc85 Declare ext/zlib constants in stubs (#9147) 2022-07-27 00:42:19 +02:00
Christoph M. Becker
5d52d472ef Fix #69181: READ_CSV|DROP_NEW_LINE drops newlines within fields
One may argue that `DROP_NEW_LINE` does not make sense in combination
with `READ_CSV`, but without `DROP_NEW_LINE`, `SKIP_EMPTY` does not
skip empty lines at all.  We could fix that, but do not for BC reasons.
Instead we no longer drop newlines in `spl_filesystem_file_read_ex()`
when reading CSV, but handle that in `spl_filesystem_file_read_csv()`
by treating lines with only (CR)LF as being empty as well.

Closes GH-7618.
2022-07-26 18:33:57 +02:00
Máté Kocsis
2fd5e82e19 Declare ext/snmp constants in stubs (#9113) 2022-07-26 14:48:16 +02:00
Christoph M. Becker
e52946eb52 Restrict range of buffer_length on all platforms to INT_MAX
This has only been done for Windows systems so far, and there was a
TODO comment about looping for larger values; that appears to be
overkill, though, since 2 million bytes should be sufficient for all
use cases, and if there is really the need for more, users can still
loop manually.  Anyhow, checking the range upfront on all platforms
is clearer then silently casting to `int`.

We split the error message for the least possible BC break.

Closes GH-9126.
2022-07-26 14:12:48 +02:00
George Peter Banyard
9115211ebf Use uint32_t in Z_PARAM_VARIADIC_WITH_NAMED 2022-07-26 11:55:26 +01:00
George Peter Banyard
bdf5a4e478 The hashvalue/index of a bucket is a zend_ulong 2022-07-26 11:54:33 +01:00
Tim Düsterhus
5c693c770a Remove ->last_unsafe from php_random_status (#9132)
Whenever ->last_unsafe is set to `true` an exception has been thrown. Thus we
can replace the check for `->last_unsafe` with a check for `EG(exception)`
which is a much more natural way to ommunicate an error up the chain.
2022-07-26 09:02:51 +02:00
Máté Kocsis
60cae26be7 Declare ext/xmlreader constants in stubs (#9133) 2022-07-26 05:57:11 +02:00
George Peter Banyard
04f6fe4b25 Ammend DBA error message to use standard messaging 2022-07-26 00:25:39 +01:00
Michael Voříšek
60189aa96a Skip locale tests /w musl libc (#9141) 2022-07-25 23:56:14 +01:00
Máté Kocsis
062003e611 Declare ext/xsl constants in stubs (#9134) 2022-07-25 21:32:07 +02:00
Máté Kocsis
867c514fe5 Declare ext/xml constants in stubs (#9131) 2022-07-25 21:31:24 +02:00
Máté Kocsis
f4b5051c29 Declare ext/zend_test constants in stubs (#9135) 2022-07-25 20:55:58 +02:00
David Carlier
9090e2602e sockets ext for solaris update.
socket filter support, system can support up to 32 filters giving the possibility to retrive the full list.
Closes #8191.
2022-07-25 19:28:25 +01:00
Christoph M. Becker
baebb730b4 Merge branch 'PHP-8.1'
* PHP-8.1:
  Initialize blacklist_path_length
2022-07-25 19:12:12 +02:00
Christoph M. Becker
7d36703a8f Initialize blacklist_path_length
For some reason, GCC warns[1]:

| ‘blacklist_path_length’ may be used uninitialized in this function
| [-Werror=maybe-uninitialized]

This looks like a false positive to me, but it doesn't hurt to
explicitly initialize the variable.

[1] <https://github.com/php/php-src/runs/7502212969?check_suite_focus=true>

Closes GH-9129.
2022-07-25 19:10:42 +02:00
Máté Kocsis
a05a6c555d Declare ext/soap constants in stubs (#9124) 2022-07-25 16:40:41 +02:00
Christoph M. Becker
f78ae8d114 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix GH-9033: Loading blacklist file can fail due to negative length
2022-07-25 16:33:15 +02:00
Christoph M. Becker
4834cfea1a Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-9033: Loading blacklist file can fail due to negative length
2022-07-25 16:32:18 +02:00
Christoph M. Becker
35fd97c3c9 Fix GH-9033: Loading blacklist file can fail due to negative length
If the blacklist file contains a line with a single double-quote, we
called `zend_strndup(pbuf, -1)` what causes an unnecessary bail out;
instead we just ignore that line.

If the blacklist file contains an empty line, we may have caused an OOB
read; instead we just ignore that line.

Closes GH-9036.
2022-07-25 16:30:19 +02:00
Máté Kocsis
4ad7e7251d Declare ext/sysvmsg constants in stubs (#9125)
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
2022-07-25 16:21:01 +02:00
Dmitry Stogov
87cf05e8be Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix type inference
2022-07-25 15:55:15 +03:00
Dmitry Stogov
d50875c822 Fix type inference
Fixes oss-fuzz #49423 and #49474
2022-07-25 15:53:06 +03:00
David Carlier
53ae24e435 zend defines attribute malloc for Win32 as returned pointer are not aliased
Closes #9118.
2022-07-25 13:43:41 +01:00
Dmitry Stogov
9d52081741 Merge branch 'PHP-8.1'
* PHP-8.1:
  JIT: Fix missing type stote
2022-07-25 15:25:08 +03:00
Dmitry Stogov
e70d282077 JIT: Fix missing type stote
Fixes oss-fuzz #49402
2022-07-25 15:24:26 +03:00
Martin Herndl
229b189293 [ci skip] Fix str_split NEWS and UPGRADE note
Closes GH-9123.
2022-07-25 13:45:01 +02:00
Dmitry Stogov
4227fddf4d Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix memory leak
2022-07-25 12:08:09 +03:00