1
0
mirror of https://github.com/php/php-src.git synced 2026-03-27 01:32:22 +01:00
Commit Graph

122626 Commits

Author SHA1 Message Date
Remi Collet
fde24e4db0 NEWS + bump zip version 2021-09-01 15:51:24 +02:00
Remi Collet
a6ffd8d1e9 Fix #80833 ZipArchive::getStream doesn't use setPassword 2021-09-01 15:49:46 +02:00
Nikita Popov
db055fdb89 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Avoid dangling pointer in curl header.str
2021-08-31 17:24:30 +02:00
Alexey Zamorov
8c292a2f9d Avoid dangling pointer in curl header.str
If buf_len is zero, this would leave behind a dangling pointer
to an already released header.str. Make sure this can't happen
by always overwriting the pointer.

Closes GH-7376.
2021-08-31 17:23:58 +02:00
Nikita Popov
416dd524f9 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix curl_copy_handle() with CURLINFO_HEADER_OUT
2021-08-31 17:09:07 +02:00
Nikita Popov
30e791ed56 Fix curl_copy_handle() with CURLINFO_HEADER_OUT
The CURLOPT_DEBUGDATA will point to the old curl handle after
copying. Update it to point to the new handle.

We don't separately store whether CURLINFO_HEADER_OUT is enabled,
so I'm doing this unconditionally. It should be harmless if
CURLOPT_DEBUGFUNCTION is not used.
2021-08-31 17:06:41 +02:00
Nikita Popov
1d506250bf Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Error on resource ID space overflow
2021-08-31 10:42:52 +02:00
Nikita Popov
501f1a45f5 Error on resource ID space overflow
When more than INT_MAX resource are created, throw a fatal error,
rather than reusing already allocated IDs, which will result in
assertion failures or crashes down the line.

This doesn't fix the fundamental problem, but makes the failure
more graceful with an obvious cause.

Inspired by https://bugs.php.net/bug.php?id=81399.

Closes GH-7428.
2021-08-31 10:41:57 +02:00
Máté Kocsis
26aa54e098 Fix default value of $flags in oci_fetch_all() (#7429) 2021-08-31 10:05:24 +02:00
Christoph M. Becker
fcbe737218 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #81400: Unterminated string in dns_get_record() results
2021-08-30 18:52:40 +02:00
Christoph M. Becker
edab9ad205 Fix #81400: Unterminated string in dns_get_record() results
If we assemble a zend_string manually, we need to end it with a NUL
byte ourselves.

We also fix the size calculation for that zend_string; there is no need
for the extra byte for each part, and we don't have to multiply by two,
since we're using DnsQuery_A(), not DnsQuery_W () (in which case we
would have to do the character set conversion, anyway).  This avoids
over-allocation, and the need to explicitly set the string length.

Finally, we use the proper access macro for zend_strings.

Closes GH-7427.
2021-08-30 18:49:39 +02:00
Máté Kocsis
e94731f164 Use camelCase method names in OCICollection and OCILob (#7405) 2021-08-30 14:01:12 +02:00
Máté Kocsis
cdf0550fe5 Fix a few func info entries 2021-08-27 16:45:32 +02:00
Máté Kocsis
492821a302 Fix func info for str_replace() and str_ireplace() 2021-08-27 12:53:44 +02:00
Nikita Popov
9d70946b16 Remove incorrect refcount info for addcslashes()
This function may return the input string.
2021-08-27 12:13:08 +02:00
Nikita Popov
2467f759f5 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix Closure::call() on internal method closure
2021-08-27 11:59:38 +02:00
Nikita Popov
eda9f5f740 Fix Closure::call() on internal method closure
In this case we should use the original internal handler. Otherwise
the trampoline will attempt to free the closure, but the function
being used is not actually part of a closure anymore.
2021-08-27 11:58:13 +02:00
Christoph M. Becker
35e1f134f5 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #53580: During resize gdImageCopyResampled cause colors change
2021-08-26 18:41:08 +02:00
Christoph M. Becker
526407ca35 Fix #53580: During resize gdImageCopyResampled cause colors change
We port the upstream fix[1], and also revert commit a3383ac3d7[2] which
is now obsolete, and also not part of libgd.  Especially the change to
gd.png.c was at best a half-baked optimization.

[1] <a24e96f019>
[2] <a3383ac3d7>

Closes GH-7402.
2021-08-26 18:38:17 +02:00
Nikita Popov
cba166469d imagecolorsforindex() cannot return false 2021-08-26 16:36:27 +02:00
Máté Kocsis
780293baec Sync ext/mysqli optimizer func info entries with the stubs 2021-08-26 12:13:42 +02:00
Derick Rethans
802316301d Merge branch 'PHP-7.4' into PHP-8.0 2021-08-25 16:00:14 +01:00
Derick Rethans
3677db6386 Backport speling fix
This change was originall only done for 'master'. Xdebug bundles this file as
it requires it, but PHP 7.2/7.3 don't have it bundled. By doing "phpize" with
master, it updates the file introducing a local diff. By fixing it in older
versions, that problem goes away.
2021-08-25 15:58:28 +01:00
Máté Kocsis
41ab369791 Fix a few optimizer func info
Closes GH-7396
2021-08-24 15:12:18 +02:00
Christoph M. Becker
ddd21d1e63 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  7.3.31 is next
2021-08-24 12:52:36 +02:00
Christoph M. Becker
5337229a50 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  7.3.31 is next
2021-08-24 12:51:06 +02:00
Christoph M. Becker
521bd7ce15 7.3.31 is next 2021-08-24 12:47:21 +02:00
Máté Kocsis
c58a9f2a57 Declare a few missing function return types
Closes GH-7395
2021-08-24 11:38:50 +02:00
Stanislav Malyshev
ffcf5ba4ae Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix test
2021-08-23 23:43:58 -07:00
Stanislav Malyshev
c1f427b506 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix test
2021-08-23 23:43:51 -07:00
Stanislav Malyshev
b815645aac Fix test 2021-08-23 23:43:32 -07:00
Stanislav Malyshev
33e4174d1c Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Update NEWS
  Fix #81211: Symlinks are followed when creating PHAR archive
2021-08-23 23:30:34 -07:00
Stanislav Malyshev
40db8947e2 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update NEWS
  Fix #81211: Symlinks are followed when creating PHAR archive
2021-08-23 23:29:01 -07:00
Stanislav Malyshev
b2008ab97d Update NEWS 2021-08-23 23:28:27 -07:00
Christoph M. Becker
2ff853aa11 Fix #81211: Symlinks are followed when creating PHAR archive
It is insufficient to check whether the `base` is contained in `fname`;
we also need to ensure that `fname` is properly separated.  And of
course, `fname` has to start with `base`.
2021-08-23 23:25:16 -07:00
Nikita Popov
2e343fcb42 Mark PDO::setAttribute() $value as mixed
For consistency with PDOStatement::setAttribute(). Attribute values
can for example also be bool.

This is backwards-compatible, as mixed is the same as no type for
parameter variance.
2021-08-20 16:51:52 +02:00
Christoph M. Becker
465b3ab2f9 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #78819: Heap Overflow in msg_send
2021-08-18 16:37:58 +02:00
Christoph M. Becker
9494b1cdc4 Fix #78819: Heap Overflow in msg_send
We need to use the proper type.

Closes GH-7386.
2021-08-18 16:35:16 +02:00
Christoph M. Becker
d71a0dcc76 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #73122: Integer Overflow when concatenating strings
2021-08-18 14:52:59 +02:00
Christoph M. Becker
0b7dffb41f Fix #73122: Integer Overflow when concatenating strings
We must avoid integer overflows in memory allocations, so we introduce
an additional check in the VM, and bail out in the rare case of an
overflow.

Closes GH-7381.
2021-08-18 14:49:09 +02:00
Nikita Popov
3454ea36a4 Test file_cache prime shm + use file combination
We're currently only testing prime shm + use shm and prime file +
use file.

This adds testing for the prime shm + use file combination. The
prime file + use shm combination is broken on PHP-8.0, so not
tested.
2021-08-18 12:38:36 +02:00
Nikita Popov
de7ba3e737 Fix repeated file cache unserialization of zval string
The IS_UNSERIALIZED check here does not work if the string is
interned (serialized with file_cache_only=0) but unserialization
happens with file_cache_only=1. In this case the unserializde
string will be in the str area after mem, which is not included
in the script size, and which is also not accessible at this
point without threading through more information. Work around
the problem by checking for the serialized representation instead.
2021-08-18 12:38:27 +02:00
Nikita Popov
8f1a217a1f Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Backport Laravel test hack
2021-08-18 09:57:31 +02:00
Nikita Popov
51147e2f18 Backport Laravel test hack
The way to work around this changed, backport the version from
master.
2021-08-18 09:55:24 +02:00
Christoph M. Becker
11cb508006 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Revert "Fix #73122: Integer Overflow when concatenating strings"
  Fix #73122: Integer Overflow when concatenating strings
2021-08-17 15:58:58 +02:00
Christoph M. Becker
f3c45c1731 Revert "Fix #73122: Integer Overflow when concatenating strings"
This reverts commit f1ce8d5f58, which has
been accidentially pushed.
2021-08-17 15:57:32 +02:00
Christoph M. Becker
f1ce8d5f58 Fix #73122: Integer Overflow when concatenating strings
We must avoid integer overflows in memory allocations, so we introduce
an additional check in the VM, and bail out in the rare case of an
overflow.  Since the recent fix for bug #74960 still doesn't catch all
possible overflows, we fix that right away.
2021-08-17 15:48:58 +02:00
Nikita Popov
b66168e86b Fix maybe-uninitialized warning
Some GCC versions don't like zend_try in loop. Avoid the issue
by pulling it out of the loop, we don't particularly care about
skipping further warnings if a bailout occurs, just that it
does not interrupt shutdown.

Closes GH-7380.
2021-08-17 12:27:32 +02:00
Christoph M. Becker
e45a063f4b Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #71542: disk_total_space does not work with relative paths
2021-08-17 11:31:14 +02:00
Christoph M. Becker
f924e97269 Fix #71542: disk_total_space does not work with relative paths
For ZTS builds, we need to expand the path given to `disk_free_space()`
and `disk_total_space()` to properly support the VCWD.

Closes GH-7377.
2021-08-17 11:29:33 +02:00