]> granicus.if.org Git - php/log
php
4 years agoFix PVS-Studio integration
Christoph M. Becker [Thu, 28 May 2020 13:20:06 +0000 (15:20 +0200)]
Fix PVS-Studio integration

Without this configuration option, PVS-Studio looks for preprocessed
files (*.i), but these do not exists.

4 years agoFixed possible usage of uninitialized value
Dmitry Stogov [Wed, 27 May 2020 08:25:18 +0000 (11:25 +0300)]
Fixed possible usage of uninitialized value

4 years ago7.3.20 will be next
Christoph M. Becker [Tue, 26 May 2020 08:53:22 +0000 (10:53 +0200)]
7.3.20 will be next

4 years agoFix #79615: Wrong GIF header written in GD GIFEncode
Christoph M. Becker [Fri, 22 May 2020 07:11:28 +0000 (09:11 +0200)]
Fix #79615: Wrong GIF header written in GD GIFEncode

The color resolution is expected in bits 4-6 of the packed fields byte
of the logical screen descriptor (byte 10 of the GIF data stream),
according to the specification[1], section 18.

[1] <https://www.w3.org/Graphics/GIF/spec-gif89a.txt>

4 years agoFix INI setting member name
Christoph M. Becker [Mon, 18 May 2020 14:07:16 +0000 (16:07 +0200)]
Fix INI setting member name

Since the member is not used in `OnUpdateEol()` that's not really an
issue, but still it's confusing to apparently have two INI settings
targeting the same member.

4 years agoPut Xdebug 3 into 'off' mode for run-tests.php
Derick Rethans [Mon, 18 May 2020 12:49:12 +0000 (13:49 +0100)]
Put Xdebug 3 into 'off' mode for run-tests.php

4 years agoFix #79596: MySQL FLOAT truncates to int some locales
Christoph M. Becker [Fri, 15 May 2020 07:09:41 +0000 (09:09 +0200)]
Fix #79596: MySQL FLOAT truncates to int some locales

We must not do locale aware float to string conversion here; instead
we using our `snprintf()` implementation with the `F` specifier.

4 years agoFix #79588: Boolean opcache settings ignore on/off values
Christoph M. Becker [Tue, 12 May 2020 14:14:54 +0000 (16:14 +0200)]
Fix #79588: Boolean opcache settings ignore on/off values

We should display boolean INI settings as boolean.

4 years agoFix #79489: .user.ini does not inherit
Christoph M. Becker [Tue, 5 May 2020 08:36:16 +0000 (10:36 +0200)]
Fix #79489: .user.ini does not inherit

On Windows, PATH_TRANSLATED may contain backslashes as well as slashes,
so we must not only check for `DEFAULT_SLASH`.

4 years ago[ci skip] Update NEWS
Christoph M. Becker [Tue, 12 May 2020 09:16:55 +0000 (11:16 +0200)]
[ci skip] Update NEWS

4 years agoMerge branch 'PHP-7.2' into PHP-7.3
Remi Collet [Tue, 12 May 2020 07:19:11 +0000 (09:19 +0200)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  bump version to 7.2.32-dev
  Update NEWS

4 years agobump version to 7.2.32-dev
Remi Collet [Tue, 12 May 2020 07:16:01 +0000 (09:16 +0200)]
bump version to 7.2.32-dev

4 years agoUpdate NEWS
Stanislav Malyshev [Mon, 11 May 2020 21:28:51 +0000 (14:28 -0700)]
Update NEWS

4 years agoMerge branch 'PHP-7.2' into PHP-7.3
Stanislav Malyshev [Mon, 11 May 2020 21:20:41 +0000 (14:20 -0700)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Fix #78876: Long variables cause OOM and temp files are not cleaned
  Fix #78875: Long filenames cause OOM and temp files are not cleaned
  Update NEWS for 7.2.31
  Update CREDITS for PHP 7.2.30
  Update NEWS for PHP 7.2.30

4 years agoFix #78876: Long variables cause OOM and temp files are not cleaned
Christoph M. Becker [Wed, 18 Mar 2020 09:57:42 +0000 (10:57 +0100)]
Fix #78876: Long variables cause OOM and temp files are not cleaned

We use the proper type for size calculations, which is `size_t`.

4 years agoFix #78875: Long filenames cause OOM and temp files are not cleaned
Christoph M. Becker [Wed, 18 Mar 2020 09:26:53 +0000 (10:26 +0100)]
Fix #78875: Long filenames cause OOM and temp files are not cleaned

We must not cast `size_t` to `int` (unless the `size_t` value is
guaranteed to be less than or equal to `INT_MAX`).  In this case we can
declare `array_len` as `size_t` in the first place.

4 years agoFix default sendmail path when not found during build
Indrek Ardel [Sat, 9 May 2020 00:08:14 +0000 (03:08 +0300)]
Fix default sendmail path when not found during build

Closes GH-5548.

4 years agoFix #79566: Private SHM is not private on Windows
Christoph M. Becker [Tue, 5 May 2020 07:31:17 +0000 (09:31 +0200)]
Fix #79566: Private SHM is not private on Windows

We map the POSIX semantics of `IPC_PRIVATE` by creating unnamed file
mapping objects on Windows.  While that is not particularly useful for
ext/shmop, which is the only bundled extension which uses `shmget()`,
it may be useful for external extensions.

4 years agoFix #79561: dns_get_record() fails with DNS_ALL
Christoph M. Becker [Mon, 4 May 2020 14:51:51 +0000 (16:51 +0200)]
Fix #79561: dns_get_record() fails with DNS_ALL

Since Windows has its own definitions of the `PHP_DNS_*` macros, we
have to use these when registering the PHP constants.

4 years agoFixed bug #79535
Nikita Popov [Mon, 4 May 2020 12:50:31 +0000 (14:50 +0200)]
Fixed bug #79535

We did not allocate a cache slot for FETCH_CLASS. This is already
fixed on newer PHP versions.

4 years agoAdd basic sapi_windows_cp_conv() test
Christoph M. Becker [Mon, 4 May 2020 09:46:54 +0000 (11:46 +0200)]
Add basic sapi_windows_cp_conv() test

This function is lacking any tests so far.

4 years agoFix #79528: Different object of the same xml between 7.4.5 and 7.4.4
Christoph M. Becker [Fri, 1 May 2020 10:19:32 +0000 (12:19 +0200)]
Fix #79528: Different object of the same xml between 7.4.5 and 7.4.4

Revert "Fix #61597: SXE properties may lack attributes and content"

This reverts commit 7c081db885756d7b176a55b90b8746f664d1e042.

4 years agoBump version
Christoph M. Becker [Tue, 28 Apr 2020 07:10:50 +0000 (09:10 +0200)]
Bump version

4 years agoFix #79470: PHP incompatible with 3rd party file system on demand
Christoph M. Becker [Fri, 24 Apr 2020 15:24:25 +0000 (17:24 +0200)]
Fix #79470: PHP incompatible with 3rd party file system on demand

We add support for Activision HSM (`IO_REPARSE_TAG_ACTIVISION_HSM`) and
VFS for Git (`IO_REPARSE_TAG_PROJFS`).  The latter fixes bug #78784.

4 years agoUpdated to version 2020.1 (2020a)
Derick Rethans [Fri, 24 Apr 2020 11:31:30 +0000 (12:31 +0100)]
Updated to version 2020.1 (2020a)

4 years agoAdd additional preg_match test case
Graham Campbell [Tue, 7 Apr 2020 13:41:06 +0000 (15:41 +0200)]
Add additional preg_match test case

(cherry picked from commit a1a044dcc74379fafb2b63db5ab033aa062aada7
on author's explicit request)

4 years agoFix #79503: Memory leak on duplicate metadata
Christoph M. Becker [Wed, 22 Apr 2020 12:11:13 +0000 (14:11 +0200)]
Fix #79503: Memory leak on duplicate metadata

Duplicate metadata can only happen if someone tampers with the phar, so
we can and should treat that as error.

4 years agoFix #79491: Search for .user.ini extends up to root dir
Christoph M. Becker [Sun, 19 Apr 2020 12:22:24 +0000 (14:22 +0200)]
Fix #79491: Search for .user.ini extends up to root dir

The `start` parameter of `php_cgi_ini_activate_user_config` is supposed
to hold the byte offset of the doc root in the given `path`.  However,
the current expression which fixes a potential type incompatibility
will ever only evaluate to zero or one, because it uses the *logical*
and operator (`&&`).  Furthermore we notice that subtracting one from
`doc_root_len` is not necessary, so there is even no need for the
`start` parameter at all.

4 years agoApply doc root fix for FPM
Nikita Popov [Mon, 20 Apr 2020 08:46:20 +0000 (10:46 +0200)]
Apply doc root fix for FPM

This is the change from GH-5417 but for FPM. This was stripping the
last character from the doc_root. Given how it is used, this should
be harmless, but let's make it less confusing...

4 years agoFix #79497: Fix php_openssl_subtract_timeval()
Joe Cai [Sun, 19 Apr 2020 23:03:11 +0000 (09:03 +1000)]
Fix #79497: Fix php_openssl_subtract_timeval()

I stumbled upon this while debugging a strange issue with
stream_socket_client() where it randomly throws out errors when
the connection timeout is set to below 1s. The logic to calculate
time difference in php_openssl_subtract_timeval() is wrong when
a.tv_usec < b.tv_usec, causing connection errors before the timeout
is reached.

4 years agozend_timeout() may access EX(opline)
Dmitry Stogov [Fri, 17 Apr 2020 11:55:14 +0000 (14:55 +0300)]
zend_timeout() may access EX(opline)

4 years agoFix MySQL local infile / attr handling on big endian systems
guirish [Fri, 10 Apr 2020 09:45:40 +0000 (05:45 -0400)]
Fix MySQL local infile / attr handling on big endian systems

Make sure pointer types match what is used by libmysql everywhere.

Closes GH-5380.

4 years agoFixed bug #79477
Nikita Popov [Wed, 15 Apr 2020 09:20:33 +0000 (11:20 +0200)]
Fixed bug #79477

Make sure to deindirect properties when creating array.

4 years agoAdd missing CVE
Christoph M. Becker [Tue, 14 Apr 2020 16:18:18 +0000 (18:18 +0200)]
Add missing CVE

4 years agoUpdate NEWS for 7.2.31
Sara Golemon [Tue, 14 Apr 2020 15:38:55 +0000 (15:38 +0000)]
Update NEWS for 7.2.31

4 years agoUpdate CREDITS for PHP 7.2.30
Sara Golemon [Tue, 14 Apr 2020 15:16:26 +0000 (15:16 +0000)]
Update CREDITS for PHP 7.2.30

4 years agoUpdate NEWS for PHP 7.2.30
Sara Golemon [Tue, 14 Apr 2020 15:16:26 +0000 (15:16 +0000)]
Update NEWS for PHP 7.2.30

4 years agoMerge branch 'PHP-7.2' into PHP-7.3
Sara Golemon [Tue, 14 Apr 2020 14:31:35 +0000 (10:31 -0400)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Fixed bug #79468
  NEWS

4 years agoFixed bug #79468
dinosaur [Mon, 13 Apr 2020 23:46:34 +0000 (07:46 +0800)]
Fixed bug #79468

Close the stream filter resources when removing them from the stream.

4 years agoNEWS
Sara Golemon [Tue, 14 Apr 2020 14:25:37 +0000 (10:25 -0400)]
NEWS

4 years agoDon't leak peername if accept fails
Nikita Popov [Tue, 14 Apr 2020 14:05:57 +0000 (16:05 +0200)]
Don't leak peername if accept fails

Even if the accept fails, the peername may be populated.

4 years agoFix test cases
Christoph M. Becker [Tue, 14 Apr 2020 11:55:56 +0000 (13:55 +0200)]
Fix test cases

4 years agoFixed bug #79468
dinosaur [Mon, 13 Apr 2020 23:46:34 +0000 (07:46 +0800)]
Fixed bug #79468

Close the stream filter resources when removing them from the stream.

4 years agoAdd NEWS entries [ci skip]
Christoph M. Becker [Tue, 14 Apr 2020 06:53:35 +0000 (08:53 +0200)]
Add NEWS entries [ci skip]

4 years agoMerge branch 'PHP-7.2' into PHP-7.3
Stanislav Malyshev [Tue, 14 Apr 2020 04:09:08 +0000 (21:09 -0700)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Fix bug #79465 - use unsigneds as indexes.
  Fix bug #79330 - make all execution modes consistent in rejecting \0

4 years agoFix bug #79465 - use unsigneds as indexes.
Stanislav Malyshev [Tue, 14 Apr 2020 04:07:04 +0000 (21:07 -0700)]
Fix bug #79465 - use unsigneds as indexes.

4 years agoFix bug #79330 - make all execution modes consistent in rejecting \0
Stanislav Malyshev [Tue, 14 Apr 2020 04:00:44 +0000 (21:00 -0700)]
Fix bug #79330 - make all execution modes consistent in rejecting \0

4 years agoFix memory leak introduced by fixing bug #78221
Christoph M. Becker [Wed, 8 Apr 2020 08:35:54 +0000 (10:35 +0200)]
Fix memory leak introduced by fixing bug #78221

We have to free the retrieved text content; to keep the code readable,
we extract a helper function to check for empty nodes.  Unfortunately,
we cannot use xmlIsBlankNode(), because that also recognizes whitespace
only text content.

We also make sure to properly handle NULL returns from
xmlNodeGetContent().

4 years agoRevert "Went to fast and forgot to update tests"
George Peter Banyard [Tue, 7 Apr 2020 20:24:40 +0000 (22:24 +0200)]
Revert "Went to fast and forgot to update tests"

This reverts commit 656eac74fa6074aebc087bb73d2e4651f7dc8c9e.

4 years agoRevert "Fix Bug #79448 0 is a valid Unicode codepoint, but mb_substitute_character...
George Peter Banyard [Tue, 7 Apr 2020 20:23:24 +0000 (22:23 +0200)]
Revert "Fix Bug #79448 0 is a valid Unicode codepoint, but mb_substitute_character(0) fails"

This commit brings some substantial changes in behaviour due to the weird implementation.
This will be fixed in master due to BC concerns.

This reverts commit 1333b46d6dc0c293c1fd626803f91bc69743eb79.

4 years agoFix #78221: DOMNode::normalize() doesn't remove empty text nodes
Christoph M. Becker [Wed, 11 Mar 2020 12:02:09 +0000 (13:02 +0100)]
Fix #78221: DOMNode::normalize() doesn't remove empty text nodes

If a text node is not followed by another text node, we remove it, if
its textContent is empty.

4 years agoWent to fast and forgot to update tests
George Peter Banyard [Fri, 3 Apr 2020 20:03:00 +0000 (22:03 +0200)]
Went to fast and forgot to update tests

However due to the really lax conversion to integer all strings pass as 0

4 years agoFix Bug #79448 0 is a valid Unicode codepoint, but mb_substitute_character(0) fails
George Peter Banyard [Fri, 3 Apr 2020 19:16:04 +0000 (21:16 +0200)]
Fix Bug #79448 0 is a valid Unicode codepoint, but mb_substitute_character(0) fails

4 years agoFix incorrect free for last_message
Qianqian Bu [Fri, 3 Apr 2020 07:44:41 +0000 (15:44 +0800)]
Fix incorrect free for last_message

In commit a7305eb539596e175bd6c3ae9a20953358c5d677 the last_message
field of the connection object was changed to be always non-persistent.
But there is a place on change_user path that still treats it
depending on conn->persistent flag. This will cause PHP crash after
com_change_user success when there is last_message set

4 years agoFixed bug #79434
Nikita Popov [Thu, 2 Apr 2020 14:32:57 +0000 (16:32 +0200)]
Fixed bug #79434

4 years agoFix literal compaction collision between string and double
Nikita Popov [Wed, 1 Apr 2020 12:20:59 +0000 (14:20 +0200)]
Fix literal compaction collision between string and double

For the sake of simplicity I'm using a separate hashtable, rather
than trying to do hash perturabation on the double strings.

4 years agoAdd NEWS entryc [ci skip]
Christoph M. Becker [Wed, 1 Apr 2020 07:26:20 +0000 (09:26 +0200)]
Add NEWS entryc [ci skip]

4 years agoFix bug 79441
George Peter Banyard [Wed, 1 Apr 2020 02:29:20 +0000 (04:29 +0200)]
Fix bug 79441

4 years agoNext is 7.3.18
Christoph M. Becker [Tue, 31 Mar 2020 08:22:55 +0000 (10:22 +0200)]
Next is 7.3.18

4 years agoFix #79413: session_create_id() fails for active sessions
Christoph M. Becker [Thu, 26 Mar 2020 18:01:33 +0000 (19:01 +0100)]
Fix #79413: session_create_id() fails for active sessions

The comment on `PS_VALIDATE_SID_FUNC(files)` is very clear that the
function is supposed to return `SUCCESS` if the session already exists.
So to detect a collision, we have to check for `SUCCESS`, not
`FAILURE`.

We also fix the wrong condition in session_regenerate_id() as well.

4 years agoFix #79427: Integer Overflow in shmop_open()
Christoph M. Becker [Sun, 29 Mar 2020 14:56:57 +0000 (16:56 +0200)]
Fix #79427: Integer Overflow in shmop_open()

If `shm.shm_segsz > ZEND_LONG_MAX` the assignment to `shmop->size` a
few lines below would overflow, so we catch that early and bail out if
necessary.

4 years agoFix #79424 ext/zip: don't use gl_pathc after call to globfree
Max Rees [Fri, 27 Mar 2020 17:57:24 +0000 (12:57 -0500)]
Fix #79424 ext/zip: don't use gl_pathc after call to globfree

This breaks on Linux with the musl libc, since it zeroes out gl_pathc during
globfree.

4 years agoAdd missing 'skip' to bug79332.phpt skip message
Lukas Berger [Thu, 26 Mar 2020 17:39:39 +0000 (10:39 -0700)]
Add missing 'skip' to bug79332.phpt skip message

The skip message must start with the word 'skip', otherwise the test will not be skipped.

*Before:*
Running selected tests.
TEST 1/1 [ext/com_dotnet/tests/bug79332.phpt]
========DIFF========
001+ Fatal error: Uncaught Error: Class 'COMPersistHelper' not found in /srv/php/ext/com_dotnet/tests/bug79332.php:2
001- A com_exception has been thrown
002+ Stack trace:
003+ #0 {main}
004+   thrown in /srv/php/ext/com_dotnet/tests/bug79332.php on line 2
========DONE========
FAIL Bug #79332 (php_istreams are never freed) [ext/com_dotnet/tests/bug79332.phpt]

*After:*
Running selected tests.
SKIP Bug #79332 (php_istreams are never freed) [ext/com_dotnet/tests/bug79332.phpt] reason: com_dotnet extension not available

4 years agoFixed bug #79412 (Opcache chokes and uses 100% CPU on specific script).
Dmitry Stogov [Wed, 25 Mar 2020 14:31:06 +0000 (17:31 +0300)]
Fixed bug #79412 (Opcache chokes and uses 100% CPU on specific script).

4 years agoFix bug #79410 (system() swallows last chunk if it is exactly 4095 bytes without...
Christian Schneider [Tue, 24 Mar 2020 15:43:17 +0000 (16:43 +0100)]
Fix bug #79410 (system() swallows last chunk if it is exactly 4095 bytes without newline)

Closes GH-5292.

4 years agoAdd test file
Nikita Popov [Mon, 23 Mar 2020 16:13:57 +0000 (17:13 +0100)]
Add test file

Forgot the git add again...

4 years agoHandle NULL caller_call_opline
Nikita Popov [Mon, 23 Mar 2020 16:10:54 +0000 (17:10 +0100)]
Handle NULL caller_call_opline

This can happen if there is an EXIT in the call arguments, in which
case the DO_CALL opcode may be eliminated as unreachable.

4 years agoFix test for Windows
Christoph M. Becker [Mon, 23 Mar 2020 15:19:25 +0000 (16:19 +0100)]
Fix test for Windows

Windows filenames may very well contain a colon, so we adjust the test
accordingly.

4 years agoFix #79200: Some iconv functions cut Windows-1258
Christoph M. Becker [Mon, 16 Mar 2020 12:09:16 +0000 (13:09 +0100)]
Fix #79200: Some iconv functions cut Windows-1258

To cater to potentially state-dependent encodings, we have to reset the
conversion descriptor into its initial shift state to properly finish
the conversion.  Furthermore, state-dependent encodings may not show
progress when comparing `in_left` before and after the conversion; we
rather have to see whether `out_left` has decreased.  Also we have to
cater to the fact that the final potentially state resetting call does
not signal failure, but we still have to break respective loops
afterwards.

4 years agoFix #79393: Null coalescing operator failing with SplFixedArray
Christoph M. Becker [Wed, 18 Mar 2020 16:39:27 +0000 (17:39 +0100)]
Fix #79393: Null coalescing operator failing with SplFixedArray

We favor the KISS principle over optimization[1] – SPL is already
special enough.

[1] <https://github.com/php/php-src/pull/2489/commits/352f3d4476a79bb86136b431719df7394e5a8d4e#r112498098>ff

4 years agoNEWS
Remi Collet [Fri, 20 Mar 2020 10:16:08 +0000 (11:16 +0100)]
NEWS

4 years agoFix Bug #79296 ZipArchive::open fails on empty file
Remi Collet [Thu, 19 Mar 2020 16:31:17 +0000 (17:31 +0100)]
Fix Bug #79296 ZipArchive::open fails on empty file

4 years agoFix #79396: DateTime hour incorrect during DST jump forward
Nate Brunette [Wed, 18 Mar 2020 20:04:46 +0000 (15:04 -0500)]
Fix #79396: DateTime hour incorrect during DST jump forward

When you attempt to set the time to a non-existent time occuring during
a DST jump forward, the hour does not move forward correctly.

4 years agoClarify session.cookie_samesite="None"
Nikita Popov [Wed, 18 Mar 2020 14:59:30 +0000 (15:59 +0100)]
Clarify session.cookie_samesite="None"

4 years agoMerge branch 'PHP-7.2' into PHP-7.3
Remi Collet [Tue, 17 Mar 2020 10:28:47 +0000 (11:28 +0100)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  bump verison to 7.2.30-dev

4 years agobump verison to 7.2.30-dev
Remi Collet [Tue, 17 Mar 2020 10:28:34 +0000 (11:28 +0100)]
bump verison to 7.2.30-dev

4 years agoMerge branch 'PHP-7.2' into PHP-7.3
Christoph M. Becker [Tue, 17 Mar 2020 10:08:45 +0000 (11:08 +0100)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Fix NEWS

4 years agoFix NEWS
Christoph M. Becker [Tue, 17 Mar 2020 10:04:24 +0000 (11:04 +0100)]
Fix NEWS

4 years agoMerge branch 'PHP-7.2' into PHP-7.3
Christoph M. Becker [Tue, 17 Mar 2020 09:56:47 +0000 (10:56 +0100)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  [ci skip] Update NEWS
  Fix test
  Fix bug #79329 - get_headers should not accept \0
  Fixed bug #79282

4 years ago[ci skip] Update NEWS
Stanislav Malyshev [Mon, 16 Mar 2020 02:35:35 +0000 (19:35 -0700)]
[ci skip] Update NEWS

4 years agoFix test
Stanislav Malyshev [Mon, 16 Mar 2020 00:55:28 +0000 (17:55 -0700)]
Fix test

4 years agoFix bug #79329 - get_headers should not accept \0
Stanislav Malyshev [Mon, 16 Mar 2020 00:30:44 +0000 (17:30 -0700)]
Fix bug #79329 - get_headers should not accept \0

4 years agoFixed bug #79282
Stanislav Malyshev [Mon, 16 Mar 2020 00:26:00 +0000 (17:26 -0700)]
Fixed bug #79282

4 years agoFix #79371: mb_strtolower (UTF-32LE): stack-buffer-overflow
Christoph M. Becker [Thu, 12 Mar 2020 12:04:04 +0000 (13:04 +0100)]
Fix #79371: mb_strtolower (UTF-32LE): stack-buffer-overflow

We make sure that negative values are properly compared.

4 years ago[ci skip] Update NEWS
Stanislav Malyshev [Mon, 16 Mar 2020 02:35:26 +0000 (19:35 -0700)]
[ci skip] Update NEWS

4 years agoFix test
Stanislav Malyshev [Mon, 16 Mar 2020 00:55:28 +0000 (17:55 -0700)]
Fix test

4 years agoFix bug #79329 - get_headers should not accept \0
Stanislav Malyshev [Mon, 16 Mar 2020 00:30:44 +0000 (17:30 -0700)]
Fix bug #79329 - get_headers should not accept \0

4 years agoFixed bug #79282
Stanislav Malyshev [Mon, 16 Mar 2020 00:26:00 +0000 (17:26 -0700)]
Fixed bug #79282

4 years agoFix typo in php.ini comment
Jacob Dreesen [Sun, 15 Mar 2020 13:11:40 +0000 (14:11 +0100)]
Fix typo in php.ini comment

4 years agoFix #79199: curl_copy_handle() memory leak
Christoph M. Becker [Wed, 11 Mar 2020 17:29:40 +0000 (18:29 +0100)]
Fix #79199: curl_copy_handle() memory leak

`curl_copy_handle()` already registers a new resource, so we must not
increase the refcount of the original resource.

4 years agoFix #61597: SXE properties may lack attributes and content
Christoph M. Becker [Sat, 7 Mar 2020 10:20:06 +0000 (11:20 +0100)]
Fix #61597: SXE properties may lack attributes and content

We must not treat a node as string if it has attributes, unless it is
an entity declaration which is always treated as string by simplexml.

4 years agoFix #78210: Invalid pointer address
Christoph M. Becker [Wed, 11 Mar 2020 09:16:04 +0000 (10:16 +0100)]
Fix #78210: Invalid pointer address

This is actually about three distinct issues:

* If an empty string is passed as $address to `stream_socket_sendto()`,
  the `sa` is not initialized, so we must not pass it as `addr` to
  `php_stream_xport_sendto()`.

* On POSIX, `recvfrom()` truncates messages which are too long to fit
  into the specified buffer (unless `MSG_PEEK` is given), discards the
  excessive bytes, and returns the buffer length.  On Windows, the same
  happens, but `recvfrom()` returns `SOCKET_ERROR` with the error code
  `WSAEMSGSIZE`.  We have to catch this for best POSIX compatibility.

* In `php_network_parse_network_address_with_port()`, we have to zero
  `in6` (not only its alias `sa`) to properly support IPv6.

Co-Authored-By: Nikita Popov <nikita.ppv@googlemail.com>
4 years agoFix #79364: When copy empty array, next key is unspecified
Christoph M. Becker [Tue, 10 Mar 2020 15:12:53 +0000 (16:12 +0100)]
Fix #79364: When copy empty array, next key is unspecified

We must not forget to keep the `nNextFreeElement` when duplicating
empty arrays.

4 years agoEnclose INI values containing {TMP} in quotes
Christoph M. Becker [Mon, 9 Mar 2020 16:58:36 +0000 (17:58 +0100)]
Enclose INI values containing {TMP} in quotes

At least on Windows, the temporary directory may contain tilde signs,
which would result in an INI parse error.

4 years agoSkip test on Windows if privileges are insufficient
Christoph M. Becker [Fri, 6 Mar 2020 15:38:18 +0000 (16:38 +0100)]
Skip test on Windows if privileges are insufficient

4 years agoFix #75673: SplStack::unserialize() behavior
Christoph M. Becker [Thu, 5 Mar 2020 13:57:27 +0000 (14:57 +0100)]
Fix #75673: SplStack::unserialize() behavior

Even though `SplStack::unserialize()` is not supposed to be called on
an already constructed instance, it is probably better if the method
clears the stack before actually unserializing.

4 years agoNext is 7.3.17
Christoph M. Becker [Tue, 3 Mar 2020 09:19:31 +0000 (10:19 +0100)]
Next is 7.3.17

4 years agoUpdate libmagic.patch
Christoph M. Becker [Wed, 26 Feb 2020 08:59:44 +0000 (09:59 +0100)]
Update libmagic.patch

Some commits missed to update the patch file, so we're catching up on
this.

To generally make this easier, we back-port generate_patch.sh from
PHP-7.4, where we now also generate magic.h from magic.h.in.

4 years agoFix #79333: com_print_typeinfo() leaks memory
Christoph M. Becker [Mon, 2 Mar 2020 10:36:30 +0000 (11:36 +0100)]
Fix #79333: com_print_typeinfo() leaks memory

We have to free the `ansiname`s, regardless of whether they have been
put into the hashtable or not.

Since bug79299.phpt already shows the leak when run with a leak
checker, there is no need for another regression test.

4 years agoFix #79332: php_istreams are never freed
Christoph M. Becker [Mon, 2 Mar 2020 09:45:37 +0000 (10:45 +0100)]
Fix #79332: php_istreams are never freed

Releasing the `com_dotnet_istream_wrapper` in `istream_destructor()` is
pointless, since `istream_destructor()` is only called when the
resource is going to be released.  This recursion is not a real issue,
though, since the resource is never exposed to userland, and has at
most refcount 1, so due to well defined unsigned integer underflow, it
never is released twice.  However, returning early in this case causes
a memory leak which needs to be fixed.