1
0
mirror of https://github.com/php/php-src.git synced 2026-04-17 13:01:02 +02:00
Commit Graph

61669 Commits

Author SHA1 Message Date
Arnaud Le Blanc
72fb511d0c Stop including php_pcre.h from spl_iterators.h
This fixes GH-7774.

spl_iterators.h was including php_pcre.h so that one object intern struct could
reference a pcre_cache_entry. These object interns should not be public, so they
can be moved out of the header file.

This change moves the object interns ouf of spl_iterators.h so that php_pcre.h
doesn't need to be included from there.
2022-04-08 10:37:12 +02:00
Christoph M. Becker
1a3b85cc64 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix GH-8267: MySQLi uses unsupported format specifier on Windows
2022-04-07 17:07:00 +02:00
Christoph M. Becker
22f8886038 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8267: MySQLi uses unsupported format specifier on Windows
2022-04-07 17:06:20 +02: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
George Peter Banyard
892270608c Minor refactoring of spl_directory.c
Using more appropriate types
Fix comments
Early returns
2022-04-07 15:12:40 +01:00
Christoph M. Becker
6828f9d1af Fix newly introduced test
We need to tell the test runner that ext/curl is required to run the
test.
2022-04-07 11:59:29 +02:00
Derick Rethans
a4f4b96c91 Updated to version 2022.1 (2022a) 2022-04-07 10:45:21 +01:00
Derick Rethans
7e829d1536 Updated to version 2022.1 (2022a) 2022-04-07 10:45:20 +01:00
Derick Rethans
7aefee1613 Updated to version 2022.1 (2022a) 2022-04-07 10:45:19 +01:00
Derick Rethans
8093ed6168 Implemented FR #51634: Can't post multiple fields with the same name
This PR allows for multiple values with the same field name to be sent to an
HTTP server. This server can't be PHP, because PHP's POST processing does not
allow for two the same field names. But sending multiple fields with the same
name is required for some operations by RFC 7578.

This PR allows you to attach an array of values to a field name, and each of
these will then be sent as its own distinct multipart/form-data field.
2022-04-07 10:01:31 +01:00
Christoph M. Becker
d03a94a0a6 Use proper types in sodium_crypto_stream_xchacha20_xor_ic()
Most importantly, `ic` needs to be of type `zend_long`, not `zend_long*`.

Closes GH-8302.
2022-04-05 16:34:12 +02:00
George Peter Banyard
2fe35cf807 Regenerate optimized func infos
Using the --generate-optimizer-info option for ./build/gen_stubs.php
2022-04-05 13:36:14 +01:00
Christoph M. Becker
012ef7912a Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix #81714: segfault when serializing finalized HashContext
2022-04-05 13:36:50 +02:00
Christoph M. Becker
187f5a362d Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix #81714: segfault when serializing finalized HashContext
2022-04-05 13:36:07 +02: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
Máté Kocsis
ee34c298f0 Merge branch 'PHP-8.1'
* PHP-8.1:
  Mark ext/mysqli properties as readonly for documentation purposes
2022-04-05 13:24:51 +02:00
Máté Kocsis
2b4fee03af Mark ext/mysqli properties as readonly for documentation purposes 2022-04-05 13:24:21 +02:00
Dmitry Stogov
df0c8aaee9 JIT: Fix array clobbering by user error handler
Fixes oss-fuzz #46336
2022-04-04 16:47:47 +03:00
Paragon Initiative Enterprises
afd8f84c1a Add sodium_crypto_stream_xchacha20_xor_ic()
There are many use-cases where a PHP user is currently using sodium_compat's implementation of this low-level XChaCha20 API. For example, multi-part message processing (in low-memory settings) for a ciphertext that was encrypted with XChaCha20-Poly1305 (rather than the secretstream API).

Adding this function to ext/sodium offers better performance and lowers users' memory usage with the polyfill, and ensures that users coming from other languages that provide libsodium bindings have a more consistent experience with our bindings. This is a win-win.

This patch follows the libsodium precedent of adding functions instead of optional parameters to existing functions. The parameter order is also consistent with the C API.

https://doc.libsodium.org/advanced/stream_ciphers/xchacha20#usage

Closes GH-8276.
2022-04-04 15:43:42 +02:00
Dmitry Stogov
4f18dbeb97 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  JIT: Fix array clobbering by user error handler
2022-04-04 16:37:17 +03: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
d260e063a8 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fixed reference counting inference
2022-04-04 15:34:57 +03:00
Dmitry Stogov
e721a42211 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fixed reference counting inference
2022-04-04 15:34:46 +03:00
Dmitry Stogov
c0bb238483 Fixed reference counting inference
Fixes oss-fuzz #46084
2022-04-04 15:34:02 +03:00
Dmitry Stogov
db34e2a68e Merge branch 'PHP-8.1'
* PHP-8.1:
  Trcing JIT: remove unchecked type guards om ROPE_* instructions
2022-04-04 15:08:01 +03:00
Dmitry Stogov
33704be5f2 Trcing JIT: remove unchecked type guards om ROPE_* instructions
Fixes oss-fuzz #46209
2022-04-04 15:06:35 +03:00
Dmitry Stogov
6156505697 Merge branch 'PHP-8.1'
* PHP-8.1:
  JIT: Fixed incorrect code generation
2022-04-04 14:24:32 +03:00
Dmitry Stogov
24bb178310 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  JIT: Fixed incorrect code generation
2022-04-04 14:24:10 +03:00
Dmitry Stogov
0d44bbd212 JIT: Fixed incorrect code generation
Fixes oss-fuzz #46328
2022-04-04 14:20:45 +03:00
Christoph M. Becker
53c6619bda Restore memory_reset_peak_usage() declaration
Cf. <https://github.com/php/php-src/pull/8151/files#r819605725>.
2022-04-01 18:13:22 +02:00
George Peter Banyard
083b64efb5 Add missing #endif in stubs
This slipped away during the rebase of 5171cb435a
2022-04-01 16:26:38 +01:00
George Peter Banyard
5171cb435a Fix [-Wundef] warnings in standard extension 2022-04-01 15:48:41 +01:00
George Peter Banyard
62ab9293ae Fix [-Wundef] warnings in SNMP extension 2022-04-01 15:45:44 +01:00
George Peter Banyard
2c2ecba063 Determine value of ZEND_MM_* during config and fix sign conversion (#6981)
Also add a new ZEND_MM_NEED_EIGHT_BYTE_REALIGNMENT definition.

This fixes many [-Wsign-conversion] warnings.

Co-authored-by: Guillaume Charifi <guillaume.charifi@sfr.fr>
Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
2022-04-01 15:43:42 +01:00
George Peter Banyard
738adce79f Fix [-Wundef] warnings in DBA extension 2022-04-01 14:38:44 +01:00
Derick Rethans
cd6c338c89 Merge branch 'PHP-8.1' 2022-04-01 13:28:13 +01:00
Derick Rethans
e6c4988187 Fixed #7752, #8101, #81660: DateTimeZone::getTransitions() returns insufficient data 2022-04-01 13:28:05 +01:00
Max Kellermann
b9e895bca0 Replace memcmp() with zend_string functions (#8216)
* ext/oci8: use zend_string_equals()

Eliminate duplicate code.

* main/php_variables: use zend_string_equals_literal()

Eliminate duplicate code.

* Zend/zend_string: add zend_string_equals_cstr()

Allows eliminating duplicate code.

* Zend, ext/{opcache,standard}, main/output: use zend_string_equals_cstr()

Eliminate duplicate code.

* Zend/zend_string: add zend_string_starts_with()

* ext/{opcache,phar,spl,standard}: use zend_string_starts_with()

This adds missing length checks to several callers, e.g. in
cache_script_in_shared_memory().  This is important when the
zend_string is shorter than the string parameter, when memcmp()
happens to check backwards; this can result in an out-of-bounds memory
access.
2022-03-31 16:27:58 +02:00
Ilija Tovilo
54440fa6eb Merge branch 'PHP-8.1'
* PHP-8.1:
  Register JSON_ERROR_NON_BACKED_ENUM constant (#8285)
2022-03-31 14:31:43 +02:00
Ilija Tovilo
2145f80d4b Register JSON_ERROR_NON_BACKED_ENUM constant (#8285)
Fixes GH-8238
2022-03-31 14:31:17 +02:00
Kamil Tekiela
15129ab688 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix mnd_malloc -> mnd_emalloc from previous merge
2022-03-31 10:54:38 +01:00
Kamil Tekiela
ced5581eca Fix mnd_malloc -> mnd_emalloc from previous merge 2022-03-31 10:53:58 +01:00
Kamil Tekiela
6a4618f7c2 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix regression from #8058
2022-03-31 10:33:56 +01:00
Kamil Tekiela
40b20d8215 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix regression from #8058
2022-03-31 10:32:59 +01:00
Kamil Tekiela
06e383b2f4 Fix regression from #8058
Closes GH-8181
2022-03-31 10:31:52 +01:00
Zhou Qingyang
48e0707620 spl_ptr_llist_offset() is not supposed to return NULL here
This issue has found by a static analyzer.

Closes GH-8272.
2022-03-30 11:38:25 +02:00
Christoph M. Becker
c9c5ee3f48 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix GH-8253: pg_insert() fails for references
2022-03-29 10:54:32 +02:00
Christoph M. Becker
7e8dcda42c Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8253: pg_insert() fails for references
2022-03-29 10:53:56 +02:00
Christoph M. Becker
0e6d6f83cc Fix GH-8253: pg_insert() fails for references
We need to deref the values.

Closes GH-8262.
2022-03-29 10:51:19 +02:00
Stanislav Malyshev
8200d667fb Merge branch 'PHP-8.1'
* PHP-8.1:
  Don't try to access memory outside string
2022-03-28 10:54:49 -06:00