Nikita Popov
61445248cb
Don't unconditionally add array value type for undef
...
We have an invariant that an array value type is set if and only
if an array key type is set, which is violated for the case of
undef values for always invalid keys.
2021-09-21 14:54:16 +02:00
Nikita Popov
f4bcf8c393
Check for undef var in typed property assignment
...
Without this check the assignment would actually silently succeed,
not just skip the warning.
2021-09-21 14:09:26 +02:00
Dmitry Stogov
48d050ef72
JIT: Disable recursive call optimization for VM without global register variables
...
A tail-call to VM handler from recursively called function may lead to
pass control to incorrect stack frame.
2021-09-21 14:30:56 +03:00
Christoph M. Becker
051036330a
[ci skip] Merge branch 'PHP-7.4' into PHP-8.0
...
* PHP-7.4:
7.3.32 is next
2021-09-21 13:20:43 +02:00
Christoph M. Becker
f70aae28a9
[ci skip] Merge branch 'PHP-7.3' into PHP-7.4
...
* PHP-7.3:
7.3.32 is next
2021-09-21 13:19:42 +02:00
Christoph M. Becker
f2f40b1cf7
7.3.32 is next
2021-09-21 13:18:08 +02:00
Christoph M. Becker
32c6a32a18
[ci skip] Merge branch 'PHP-7.4' into PHP-8.0
...
* PHP-7.4:
[ci skip] Add missing CVE to NEWS
2021-09-21 13:06:58 +02:00
Christoph M. Becker
9732381e5b
[ci skip] Merge branch 'PHP-7.3' into PHP-7.4
...
* PHP-7.3:
[ci skip] Add missing CVE to NEWS
2021-09-21 13:04:41 +02:00
Christoph M. Becker
96a5b4e43a
[ci skip] Add missing CVE to NEWS
2021-09-21 13:02:42 +02:00
Nikita Popov
95e0cc06a2
Fix missing undef checks for comparisons
2021-09-21 12:06:32 +02:00
Dmitry Stogov
0e0f50b413
JIT x86: Fixed incorrect EX(func) initialization for recursive calls
2021-09-21 13:01:27 +03:00
Christoph M. Becker
b17adffed7
[ci skip] Merge branch 'PHP-7.4' into PHP-8.0
...
* PHP-7.4:
[ci skip] Add missing NEWS entry
2021-09-21 11:46:50 +02:00
Christoph M. Becker
c014e12147
[ci skip] Merge branch 'PHP-7.3' into PHP-7.4
...
* PHP-7.3:
[ci skip] Add missing NEWS entry
2021-09-21 11:44:57 +02:00
Christoph M. Becker
bb84722364
[ci skip] Add missing NEWS entry
2021-09-21 11:43:36 +02:00
Christoph M. Becker
e0b532c247
[ci skip] Merge branch 'PHP-7.4' into PHP-8.0
...
* PHP-7.4:
Fix persistent smart_str allocation
2021-09-21 11:03:15 +02:00
Christoph M. Becker
806cada48d
[ci skip] Merge branch 'PHP-7.3' into PHP-7.4
...
* PHP-7.3:
Fix persistent smart_str allocation
2021-09-21 11:01:51 +02:00
Nikita Popov
549cb4406e
Fix persistent smart_str allocation
...
This would allocate a too small buffer if the first smart_str
allocation is > SMART_STR_START_LEN but <= SMART_STR_START_SIZE.
(cherry picked from commit af8fccee9c )
2021-09-21 10:52:43 +02:00
Dmitry Stogov
f0f774a129
JIT x86: Fixed register clobbering in code produced for "$x[$y] %= $z".
2021-09-21 10:42:53 +03:00
Stanislav Malyshev
cebff25d27
Merge branch 'PHP-7.4' into PHP-8.0
...
* PHP-7.4:
Fix #81420 : ZipArchive::extractTo extracts outside of destination
2021-09-20 21:35:43 -07:00
Stanislav Malyshev
f92bae23ce
Merge branch 'PHP-7.3' into PHP-7.4
...
* PHP-7.3:
Fix #81420 : ZipArchive::extractTo extracts outside of destination
2021-09-20 21:34:57 -07:00
Christoph M. Becker
df2ceac25a
Fix #81420 : ZipArchive::extractTo extracts outside of destination
...
We need to properly detect and handle absolute paths in a portable way.
2021-09-20 21:29:24 -07:00
George Peter Banyard
0ea38b9509
Fix Bug #81462 mime_content_type() indicates wrong arg num on TypeError
2021-09-20 22:48:00 +01:00
Christoph M. Becker
fbc922d55c
Merge branch 'PHP-7.4' into PHP-8.0
...
* PHP-7.4:
Fix #61700 : FILTER_FLAG_IPV6/FILTER_FLAG_NO_PRIV|RES_RANGE failing
2021-09-20 17:39:22 +02:00
Christoph M. Becker
288c25f7d1
Fix #61700 : FILTER_FLAG_IPV6/FILTER_FLAG_NO_PRIV|RES_RANGE failing
...
It makes no sense to compare IPv6 address ranges as strings; there are
too many different representation possibilities. Instead, we change
`_php_filter_validate_ipv6()` so that it can calculate the IP address
as integer array. We do not rely on `inet_pton()` which may not be
available everywhere, at least IPv6 support may not, but rather parse
the IP address manually. Finally, we compare the integers.
Note that this patch does not fix what we consider as reserved and
private, respectively, but merely tries to keep what we had so far.
Co-authored-by: Nikita Popov <nikita.ppv@gmail.com >
Closes GH-7476.
2021-09-20 17:38:05 +02:00
Nikita Popov
1b33da5dd2
Don't replace values in unreachable code in sccp
...
While technically legal, this may cause unexpected situations
(in this example, setting an FE_FREE operand to constant null)
and is suboptimal anyway. It's better to preserve the vacuous type
and drop it later (though we currently don't implement this).
2021-09-20 13:12:26 +02:00
Nikita Popov
b4d7387468
Make setcookie() test more robust against the passage of time
2021-09-20 10:28:45 +02:00
Nikita Popov
07f6c61c8e
Use ephemeral ports in socket test
2021-09-20 10:19:48 +02:00
Anatol Belski
125f305b1d
NEWS: Add note for bug #78987
...
Signed-off-by: Anatol Belski <ab@php.net >
2021-09-19 16:37:33 +02:00
Anatol Belski
c129f573bf
Merge branch 'PHP-7.4' into PHP-8.0
...
* PHP-7.4:
NEWS: Add note for bug #78987
2021-09-19 16:36:25 +02:00
Anatol Belski
49c9fbbfe2
NEWS: Add note for bug #78987
...
Signed-off-by: Anatol Belski <ab@php.net >
2021-09-19 16:35:26 +02:00
Anatol Belski
fafdf744fa
Merge branch 'PHP-7.4' into PHP-8.0
...
* PHP-7.4:
fileinfo: Fix test value for s390x on travis-ci
2021-09-19 16:04:35 +02:00
Anatol Belski
8f75ab0dfc
fileinfo: Fix test value for s390x on travis-ci
...
Signed-off-by: Anatol Belski <ab@php.net >
2021-09-19 16:02:30 +02:00
Anatol Belski
d225770e9e
Merge branch 'PHP-7.4' into PHP-8.0
...
* PHP-7.4:
fileinfo: Capture more sizes for test as delivered by travis-ci
fileinfo: Capture more sizes for test as delivered by AppVeyor
2021-09-18 23:17:41 +02:00
Anatol Belski
6e0acece68
fileinfo: Capture more sizes for test as delivered by travis-ci
...
Signed-off-by: Anatol Belski <ab@php.net >
2021-09-18 23:16:38 +02:00
Anatol Belski
e56435c86d
fileinfo: Capture more sizes for test as delivered by AppVeyor
...
Signed-off-by: Anatol Belski <ab@php.net >
2021-09-18 23:06:57 +02:00
Anatol Belski
a4f85a5796
Merge branch 'PHP-7.4' into PHP-8.0
...
* PHP-7.4:
fileinfo: Adjust value in test
2021-09-18 22:52:30 +02:00
Anatol Belski
0208374ad4
fileinfo: Adjust value in test
...
Signed-off-by: Anatol Belski <ab@php.net >
2021-09-18 22:51:08 +02:00
Anatol Belski
3c40d9bf77
libmagic: Update patch
...
Signed-off-by: Anatol Belski <ab@php.net >
2021-09-18 22:04:32 +02:00
Anatol Belski
2a9a521d71
Merge branch 'PHP-7.4' into PHP-8.0
...
* PHP-7.4:
fileinfo: Fixed bug #78987 High memory usage during encoding detection
2021-09-18 22:02:56 +02:00
Anatol Belski
fa96c7e000
fileinfo: Fixed bug #78987 High memory usage during encoding detection
...
The default buffer size for the encoding detection is set to 64K.
Signed-off-by: Anatol Belski <ab@php.net >
2021-09-18 21:00:30 +02:00
Dmitry Stogov
01cfd5e4f9
JIT: Fixed incorrect assignment of undefined variable
2021-09-17 18:35:55 +03:00
Nikita Popov
a49a309386
Fix FETCH_OBJ_IS type inference
...
Even if the property is typed, null is still a valid return
value in the BP_VAR_IS case. Other cases will throw instead.
2021-09-17 17:05:25 +02:00
Dmitry Stogov
015cafa38c
JIT: keep register value across call
2021-09-17 17:58:24 +03:00
Dmitry Stogov
04209de93c
JIT: Fixed warning when assign undefined variable to property
2021-09-17 16:22:06 +03:00
Christoph M. Becker
70e94379f3
Merge branch 'PHP-7.4' into PHP-8.0
...
* PHP-7.4:
Fix OOB read due to timezone_open() with 5 digit offset
2021-09-17 13:29:27 +02:00
Christoph M. Becker
fac3fbcb07
Fix OOB read due to timezone_open() with 5 digit offset
...
This has been reported as bug #78984 , and is generally and properly
fixed as of timelib 2020.3 (PHP-8.0). However, it is not fixed in
PHP-7.4, where the test results in an OOB read, and an unterminated
C string when calling `::getName()`. Therefore, we apply a minimal
fix which just avoids this dangerous behavior.
2021-09-17 13:18:51 +02:00
Nikita Popov
01453a0af7
Fix SEND_USER with ref arg
...
Even though the input is not a reference (or not treated as such),
we still need to create a reference to satisfy the function
signature. Various code relies on reference arguments actually
being references. In this particular case, it would result in
a JIT crash.
The zend_call_function() implementation already handled this
correctly.
2021-09-17 12:17:33 +02:00
Nikita Popov
d46b10296e
Don't jit FE_RESET_R with undef operand
...
The implementation currently assumes that the operand is always
an array, but this did not account for a possibly undef operand.
2021-09-17 12:04:21 +02:00
Nikita Popov
e250ce64e6
Merge branch 'PHP-7.4' into PHP-8.0
...
* PHP-7.4:
Fix persistent smart_str allocation
2021-09-16 16:29:51 +02:00
Nikita Popov
af8fccee9c
Fix persistent smart_str allocation
...
This would allocate a too small buffer if the first smart_str
allocation is > SMART_STR_START_LEN but <= SMART_STR_START_SIZE.
2021-09-16 16:29:16 +02:00