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

123637 Commits

Author SHA1 Message Date
Nikita Popov
9799cf989c Reset property table for disabled classes
To avoid retaining behavior about property visibility or types.
2021-04-20 10:35:10 +02:00
Nikita Popov
a3da56226a Use -Wno-implicit-fallthrough for pcre
sljitNativeARM_64.c has implicit fallthrough.
2021-04-20 10:07:11 +02:00
Nikita Popov
5d2f6c4d5d Update mysql version on libmysqclient job
Apparently these files don't stay available forever. Update to
a newer version.
2021-04-20 09:59:30 +02:00
George Peter Banyard
612609e1bd Refactor PGSQL extension to use zend_string*
* Prevents some unnecessary strlen() computation
 * Use interned "NULL"
 * Certain PGSQL_API functions now accept zend_string* instead of char*

Closes GH-6792
2021-04-19 20:33:40 +01:00
George Peter Banyard
0ffb4a5c9d Boolify do_exec() 2021-04-19 20:33:05 +01:00
George Peter Banyard
fabcfd6d81 Formalize return type to zend_result for PGSQL_API functions 2021-04-19 20:33:05 +01:00
George Peter Banyard
6eb23e2b83 ValueError if lengths is less than 0 2021-04-19 20:27:34 +01:00
George Peter Banyard
13693aaf7e Use ZEND_ASSERT() instead of plain assert() 2021-04-19 20:27:34 +01:00
George Peter Banyard
6569aedee3 Use ZEND_NUM_ARGS() explicitly 2021-04-19 20:27:34 +01:00
George Peter Banyard
a5fb43f2b1 Boolify _php_pgsql_link_has_results() 2021-04-19 20:27:34 +01:00
George Peter Banyard
8ae9922348 Boolify _php_pgsql_detect_identifier_escape() and rename it
New name is  _php_pgsql_identifier_is_escaped()
2021-04-19 20:27:34 +01:00
George Peter Banyard
7a1af523fa Fix test output due to float to string locale independent change
Also use de_DE locale instead
2021-04-19 20:27:33 +01:00
Christoph M. Becker
84a3f59d45 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix expected error message
2021-04-19 18:49:55 +02:00
Christoph M. Becker
8a7b786b7f Fix expected error message
These are slightly changed as of PHP 8.0.0.
2021-04-19 18:48:44 +02:00
Dmitry Stogov
08dafda123 Fixed use-after-free introduced by ca49e53670 2021-04-19 18:16:14 +03:00
Christoph M. Becker
c8a966a9ae Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #80960: opendir() warning wrong info when failed on Windows
2021-04-19 16:18:03 +02:00
Christoph M. Becker
cb262cd974 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #80960: opendir() warning wrong info when failed on Windows
2021-04-19 16:17:01 +02:00
Christoph M. Becker
ea3c992bff Fix #80960: opendir() warning wrong info when failed on Windows
Firstly, we must not forget to set appropriate error codes for "manual"
checks in `virtual_file_ex()`.

Secondly, we must not call `php_error_docref2()` for warnings regarding
unary functions; thus, we introduce `php_win32_docref1_from_error()`.

Closes GH-6872.
2021-04-19 16:12:22 +02:00
George Peter Banyard
dcdc5d9069 Drop -Wno-implicit-fallthrough compiler flag
And add it back to ext/date, ext/hash, and ext/opcache
2021-04-19 13:59:18 +01:00
George Peter Banyard
e3403d80af Use ZEND_FALLTHROUGH instead of a comment in PDO 2021-04-19 13:59:18 +01:00
George Peter Banyard
cef0076a88 Signal that the stream option passed is an error
Otherwise this falls through to the next case statement.
2021-04-19 13:59:18 +01:00
Nikita Popov
71cbef78ba Fixed bug #80111
Remove traverse_pointer before destroying the element contents.
2021-04-19 14:41:19 +02:00
Nikita Popov
044de83635 Prefer ZVAL_COPY
Instead of ZVAL_COPY_VALUE + Z_TRY_ADDREF. Also fix another leak
in SplDoublyLinkedList::add(), the push case was leaking as well.
2021-04-19 14:35:36 +02:00
Nikita Popov
497fadcacd Fix leak in SplDoublyLinkedList::add() 2021-04-19 13:08:35 +02:00
Nikita Popov
02db708cd4 Remove generic dtor+ctor from SPL dllist
This is only ever used with zvals. It was particularly confusing
because a lot of code mixed the generic code with zval specific
code.
2021-04-19 13:02:19 +02:00
Matt Brown
6cd0b48cac Implement never return type
The never type can be used to indicate that a function never
returns, for example because it always unwinds.

RFC: https://wiki.php.net/rfc/noreturn_type

Closes GH-6761.
2021-04-19 11:27:29 +02:00
Nikita Popov
6adfe9da98 Fix error messages for sodium_crypto_stream_xchacha20
And test them. Also adjust the constant check in the test so that
it actually runs.
2021-04-19 11:10:37 +02:00
P.I.E. Security Team
f7f1f7fce2 Add crypto_stream_xchacha20 to ext/sodium (#6868)
Paragon Initiative Enterprises is aware of PHP applications that use sodium_compat's ParagonIE\Sodium\Core\XChaCha20 class directly for stream encryption.

Greater performance and security assurance is offered by exposing libsodium's crypto_stream_xchacha20 API to PHP users.

It's acceptable to only include this change in PHP 8.1+; the offending applications are more than welcome to either install ext/sodium from PECL or upgrade to 8.1 when it comes out later this year.

Ref: https://github.com/jedisct1/libsodium-php/pull/211
2021-04-19 11:04:29 +02:00
Nikita Popov
8bb81226c1 Handle debug_print_backtrace() from main script
If there is nothing to print, the smart_str will hold a nullptr.

Fixes oss-fuzz #33334.
2021-04-19 10:20:30 +02:00
twosee
d05da0f06c Merge branch 'PHP-8.0'
* PHP-8.0:
  Backport "ignore some opcodes in the JIT check"
2021-04-19 14:29:17 +08:00
twosee
d4a206b276 Backport "ignore some opcodes in the JIT check"
This is a backport of fc64a7bef4 to the PHP-8.0 branch so that extensions don’t have to bypass the JIT check in a hacky way.
2021-04-19 14:28:15 +08:00
Máté Kocsis
2bebe104c1 Update mysqli arginfo hash
[skip-ci]
2021-04-18 11:03:51 +02:00
Nikita Popov
a460bf41db Fix i386 build on azure (#6877)
Explicitly specify --build=i686.
2021-04-17 20:35:01 +02:00
Christoph M. Becker
38b42314a4 Merge branch 'PHP-8.0'
* PHP-8.0:
  Update php_version.h
2021-04-16 17:56:44 +02:00
Christoph M. Becker
d918c1443e Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Update php_version.h
2021-04-16 17:45:41 +02:00
Christoph M. Becker
0071c7ed7e Update php_version.h 2021-04-16 17:42:29 +02:00
Dmitry Stogov
f1ad9199ef Better support for cross-compilation 2021-04-16 17:28:54 +03:00
twosee
0236bbc777 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #80958
2021-04-16 16:19:43 +08:00
twosee
ecc4bf14f0 Fixed bug #80958
Missing check after zval_try_get_string().

Closes GH-6871.
2021-04-16 16:17:37 +08:00
K
438189531c Speed up array_column for consecutive objects of the same class 2021-04-16 09:52:57 +02:00
twosee
122deea506 Add ASan and UBSan options (#6825)
When we need to enable ASan/UBSan in PHP extension, we also need to enable it in PHP kernel. Providing these options makes it easier for us to enable ASan/UBSan when compiling PHP.
And we use --enable-address-sanitizer and --enable-undefined-sanitizer in azure-pipelines.yml instead of changing CFLAGS manually.
We also add compile flag check to MSan.
2021-04-16 12:41:25 +08:00
twosee
559c3f6d86 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #80929
2021-04-16 09:59:01 +08:00
twosee
09f55604ec Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #80929
2021-04-16 09:49:36 +08:00
twosee
c0b1bdcdc3 Fixed bug #80929
The function name should be kept if Closure was created from the function which is marked as ZEND_ACC_CALL_VIA_TRAMPOLINE, because it is not a one-time thing and it may be called multiple times.

Closes GH-6867.
2021-04-16 09:48:36 +08:00
Nikita Popov
f1ce44d1cb Fix static variables in main script with file cache
If the script will be cached in SHM (!corrupted), then we cannot
allocate the static variables on the arena. Instead do the same
thing we do during normal persistence and allocate a map ptr slot.
2021-04-15 16:37:28 +02:00
Alex Dowad
7159907d30 Fix mbstring support for ISO-2022-JP-MS encoding
- Treat it as error if multi-byte string or escape sequence is truncated
- Don't allow 'control' characters or escape sequences to appear in the middle
  of a multi-byte char

As with ISO-2022-JP-KDDI, the main reference used to develop the tests was
the behavior of the existing code. It would have been better to have some
independent reference which we could cross-check our code against, but I
couldn't find one.
2021-04-15 15:52:31 +02:00
Alex Dowad
570e89a9f3 Fix mbstring support for ISO-2022-JP-KDDI encoding
- Treat it as an error if a multi-byte character or escape sequence is truncated
- When converting other encodings to ISO-2022-JP-KDDI, don't swallow trailing
  hash characters or digits
- Don't allow 'control' characters to appear in the middle of a multi-byte char

Note: I was not able to find any kind of official or even semi-official
specification for this legacy encoding. Therefore, the test suite for
ISO-2022-JP-KDDI is based largely on the behavior of the existing code.

Verifying the correctness of program code in this way is very questionable.
In a sense, all you are proving is that the code "does what it does". However,
the test suite will still expose any unintended _changes_ to behavior.
2021-04-15 15:52:31 +02:00
Alex Dowad
f5f3ee7aee Add test suite for mUTF-7 (IMAP) encoding 2021-04-15 15:52:31 +02:00
Alex Dowad
78dc160e3b Catch and handle errors in mUTF-7 (IMAP) conversion 2021-04-15 15:52:31 +02:00
Alex Dowad
cef4b94eef Code cleanup in mbfilter_utf7imap.c 2021-04-15 15:52:31 +02:00