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

115438 Commits

Author SHA1 Message Date
Derick Rethans d13ceb74fa Add fix to NEWS 2022-02-14 16:23:06 +00:00
Christoph M. Becker dce5e561a6 Fix #81708: UAF due to php_filter_float() failing for ints
We must only release the zval, if we actually assign a new zval.
2022-02-13 21:31:35 -08:00
Christoph M. Becker 6d5f2ba78d macOS 10.14 runners are no longer available via Azure Pipeline
These images have already been deprecated for two months[1].  Thus,
we upgrade to macOS 10.15.  Since clang 12 is picky about
`int-in-bool-context` warning, we disable `-Werror`.

[1] <https://devblogs.microsoft.com/devops/hosted-pipelines-image-deprecation/>
2021-12-12 19:11:21 +01:00
Christoph M. Becker 98175fc7f1 Fix openssl_x509_checkpurpose_basic.phpt
This test fails because san-cert.pem and san-ca.pem have expired.  We
fix that by using the CertificateGenerator to generate temporary certs
during the test run.  Since san-cert.pem and san-ca.pem have been
identical, we only generate one certificate.

Closes GH-7763.
2021-12-12 14:26:17 +01:00
Derick Rethans f533744c92 Prepare for 7.4.28 2021-11-30 18:40:42 +00:00
Christoph M. Becker 712fc54e85 Fix #74604: Out of bounds in php_pcre_replace_impl
Trying to allocate a `zend_string` with a length only slighty smaller
than `SIZE_MAX` causes an integer overflow; we make sure that this
doesn't happen by catering to the maximal overhead of a `zend_string`.

Closes GH-7597.
2021-11-29 19:12:55 +01:00
Christoph M. Becker 31749aac62 Fix #81659: stream_get_contents() may unnecessarily overallocate
Since we're going to read from the current stream position anyway, the
`max_len` should be the size of the file minus the current position
(still catering to potentially filtered streams).  We must, however,
make sure to cater to the file position being beyond the actual file
size.

While we're at, we also fix the step size in the comment, which is 8K.

A further optimization could be done for unfiltered streams, thus
saving that step size, but 8K might not be worth it.

Closes GH-7693.
2021-11-29 14:46:09 +01:00
Nikita Popov c2d6d837ca Disable enchant on azure i386
The i386 libenchant library no longer installs without conflicts,
so drop i386 testing for this extension.
2021-11-26 11:03:32 +01:00
Дилян Палаузов 60fe575ce3 Fix #75725: ./configure: detecting RAND_egd
Closes GH-7668.
2021-11-22 14:11:07 +01:00
Christoph M. Becker be1cb5a13a [ci skip] Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  7.3.34 might be next
2021-11-16 13:26:05 +01:00
Christoph M. Becker 7d92153182 7.3.34 might be next 2021-11-16 13:24:00 +01:00
Christoph M. Becker 8a2076475e [ci skip] Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  [ci skip] Fix news entry for bug #79971
  [ci skip] Update NEWS
2021-11-16 13:11:53 +01:00
Christoph M. Becker d14a9139d5 [ci skip] Fix news entry for bug #79971 2021-11-16 13:06:04 +01:00
Nikita Popov d26965b247 Fixed bug #81626
Backport of a8926474cb to 7.4.
2021-11-16 12:45:33 +01:00
Nikita Popov 18a0d46a1b Safely reassign array in usort()
Make sure to destroy the old value only after assigning the new
one. Otherwise we may try to double free, e.g. if GC runs during
this dtor.

This caused an assertion failure in phpro/grumphp and is likely
the cause for bug #81603 as well.

(cherry picked from commit 6f38acfaf9)

(I applied this to the wrong base branch at first...)
2021-11-16 10:15:47 +01:00
Matt 45f52285f6 Fix bug #81618: Correct dns_get_record on FreeBSD
Modify dns_get_record to test for records result based on dns_errno to
accommodate modern FreeBSD, for which res_nsearch() does not update
h_errno directly. Add new php_dns_errno macro, and have it consult
statp->res_h_errno when OS has res_nsearch().

Closes GH-7655.
2021-11-15 10:00:07 +01:00
Stanislav Malyshev 7967875d70 [ci skip] Update NEWS 2021-11-14 23:35:26 -08:00
Stanislav Malyshev ca87d46a3e Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79971: special character is breaking the path in xml function
2021-11-14 23:28:13 -08:00
Christoph M. Becker f15f8fc573 Fix #79971: special character is breaking the path in xml function
The libxml based XML functions accepting a filename actually accept
URIs with possibly percent-encoded characters.  Percent-encoded NUL
bytes lead to truncation, like non-encoded NUL bytes would.  We catch
those, and let the functions fail with a respective warning.
2021-11-14 23:24:33 -08:00
Jakub Zelenka b2cf9b7ec7 Fix bug #81513 (Future possibility for heap overflow in FPM zlog)
This fixes currently unused code path in zlog that could lead to
the heap overflow in the future.
2021-11-14 20:08:57 +00:00
Christoph M. Becker 1919c4b44d Fix #71316: libpng warning from imagecreatefromstring
We backport the respective upstream fix[1] to our bundled libgd.

[1] <https://github.com/libgd/libgd/commit/636100b9280a86e70d852d89251fc5492fce33f4>

Closes GH-7615.
2021-11-04 11:16:45 +01:00
Derick Rethans 905a1d5011 Merge branch 'PHP-7.3' into PHP-7.4 2021-11-03 16:13:22 +00:00
Derick Rethans 88f99c9c1d Revert "Updated to version 2021.5 (2021e)"
This reverts commit a93ff1df20.
2021-11-03 16:13:05 +00:00
Derick Rethans 7c9c722b53 Updated to version 2021.5 (2021e) 2021-11-03 15:49:24 +00:00
Derick Rethans 5715a5e570 Empty merge 2021-11-03 15:49:24 +00:00
Derick Rethans a93ff1df20 Updated to version 2021.5 (2021e) 2021-11-03 15:49:23 +00:00
George Peter Banyard 96dd310c54 Fix Bug #81588 TokyoCabinet driver leaks memory 2021-11-03 14:57:47 +00:00
Derick Rethans 05b212bb3d Prepare for 7.4.27 2021-11-02 16:39:44 +00:00
Ben Ramsey c7a2441e93 CLDR 40a0 uses a lowercase "temp" instead of "Temp" in ICU >= 70.1
Refer to:
https://github.com/unicode-org/icu/commit/49dda34fb175240a7724c7e039a270126ff7d900
2021-11-02 16:15:19 +01:00
Ben Ramsey 52cda6fc43 Accommodate changes to canonicalized forms in ICU >= 70.1
Refer to:
https://github.com/unicode-org/icu/commit/01e1adc9e412c9c3177dc3e30d056c25d8687853
2021-11-02 16:11:29 +01:00
Ben Ramsey 81b3f95622 Change UBool to bool for equality operators in ICU >= 70.1
Refer to:
- https://github.com/unicode-org/icu/commit/633438f8da99fee815e2c61626ea779a84567a3d
- https://github.com/unicode-org/icu/commit/f6325d49ba57ec26f320b2865ce09ca47db458d9
2021-11-02 16:07:51 +01:00
Christoph M. Becker 8a79668dbe [ci skip] Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  [ci skip] Fix typo (Okt → Oct)
2021-10-26 16:28:14 +02:00
Christoph M. Becker 5f4e034e57 [ci skip] Fix typo (Okt → Oct) 2021-10-26 16:26:23 +02:00
Christoph M. Becker 5aaeeda744 [ci skip] Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #81026 (PHP-FPM oob R/W in root process leading to priv escalation)
2021-10-26 16:05:26 +02:00
Jakub Zelenka f47798e685 Fix bug #81026 (PHP-FPM oob R/W in root process leading to priv escalation)
The main change is to store scoreboard procs directly to the variable sized
array rather than indirectly through the pointer.

Signed-off-by: Stanislav Malyshev <stas@php.net>
(cherry picked from commit cb2021e5f6)

Closes GH-7614.
2021-10-26 16:03:33 +02:00
Christoph M. Becker f4572d9e22 [ci skip] Fix NEWS
Bug #81026 has already been fixed in PHP 7.4.25 and 8.0.12.
2021-10-25 12:48:58 +02:00
Christoph M. Becker d3d6d7906e Fix #76167: mbstring may use pointer from some previous request
We must not reuse per-request memory across multiple requests, so this
check triggered during RINIT makes no sense.  As explained in the bug
report[1], it can be even harmful, if some request startup fails, and
the pointers refer to already freed memory in the next request.

[1] <https://bugs.php.net/76167>

Closes GH-7604.
2021-10-25 12:37:28 +02:00
Remi Collet 56495ac031 fix for pcre2 10.38 2021-10-21 13:33:35 +02:00
Stanislav Malyshev 6ab9b3865a Add FPM fix news 2021-10-18 15:04:46 -07:00
Jakub Zelenka cb2021e5f6 Fix bug #81026 (PHP-FPM oob R/W in root process leading to priv escalation)
The main change is to store scoreboard procs directly to the variable sized
array rather than indirectly through the pointer.

Signed-off-by: Stanislav Malyshev <stas@php.net>
2021-10-17 20:16:10 -07:00
Christoph M. Becker 866adb122a Fix #81500: Interval serialization regression since 7.3.14 / 7.4.2
While it may not be desired, `DateInterval::$f` supports negative
values, at least with regard to calculations.  We still need to guard
from assigning double values which are out of range for signed 64bit
integers (which would be undefined behavior).  zend_dval_to_lval() does
this by returning `0` instead of triggering UB.  This way we can avoid
setting the invalid marker, which doesn't work as expected anyway.

We must not do that only for unserialization, but also when the property
is set in the first place.

We need to adapt some of the existing tests wrt. this behavior.  In
particular, we check for an arbitrary value in bug79015.phpt, to cater
to differences between 32bit and 64bit architectures.

Closes GH-7575.
2021-10-15 19:08:07 +02:00
Christoph M. Becker 365769366b Fix #81518: Header injection via default_mimetype / default_charset
We forbid setting these INI options to values containing NUL bytes, CR
or LF.

Closes GH-7574.
2021-10-14 12:16:19 +02:00
Christoph M. Becker 788a701e22 Fix #81424: PCRE2 10.35 JIT performance regression
We backport the respective upstream fix[1] to our bundled pcre2lib plus
the follow-up fix[2] for a functional regression.

[1] <https://github.com/PhilipHazel/pcre2/commit/dc5f96663597572f694147aeec3525003c351123>
[2] <https://github.com/PhilipHazel/pcre2/commit/e7af7efaa11f71b187b0432e9e60f18ba4d90a0c>

Closes GH-7573.
2021-10-12 14:19:22 +02:00
Nikita Popov fcabe693ba Fixed bug #81494
Use the proper error reporting mechanism rather than throwing a
warning. This requires something of a hack because we don't have
direct access to the connection object at this point.
2021-10-08 15:00:10 +02:00
Derick Rethans 9733d49e14 Remove now superfluous tests due to changes in tzdata 2021-10-08 13:51:21 +01:00
Derick Rethans bcc103a402 Merge branch 'PHP-7.3' into PHP-7.4 2021-10-08 13:13:05 +01:00
Derick Rethans 32c0850b4a Revert "Updated to version 2021.3 (2021c)"
This reverts commit e81554c6e6.
2021-10-08 13:12:50 +01:00
Derick Rethans 8a61f1ece6 Updated to version 2021.3 (2021c) 2021-10-08 12:54:52 +01:00
Derick Rethans 760475b43a Empty merge 2021-10-08 12:54:51 +01:00
Derick Rethans e81554c6e6 Updated to version 2021.3 (2021c) 2021-10-08 12:54:50 +01:00