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

295 Commits

Author SHA1 Message Date
Nikita Popov 954d073833 Merge branch 'PHP-7.2' into PHP-7.3 2019-09-23 17:18:33 +02:00
Nikita Popov 3ddb63dce1 Fix skipif condition 2019-09-23 17:17:52 +02:00
Nikita Popov d0f4966b05 Merge branch 'PHP-7.2' into PHP-7.3 2019-09-23 16:42:33 +02:00
Nikita Popov bc4c4c658c Skip test on 32-bit 2019-09-23 16:42:24 +02:00
Nikita Popov 087051c9a5 Skip test on 32-bit 2019-09-23 14:52:32 +02:00
Nikita Popov f53af9ac23 Merge branch 'PHP-7.2' into PHP-7.3 2019-09-23 13:18:39 +02:00
Nikita Popov 8509970e6a Fix signed integer overflow in SplObjectStorage unserialization
If count is ZEND_LONG_MIN the count-- loop underflows. This is
ultimately harmless, but results in a ubsan warning.

Fix this by adding a sanity check that the count isn't negative,
because that doesn't make sense...
2019-09-23 13:18:27 +02:00
Nikita Popov e65adc9c19 Fix ubsan violation in parse_iv2
This fixes two issues:
 * Negative the value in an unsigned type to avoid signed overflow.
 * Treat -0 as 0 rather than an invalid number that gets converted
   to ZEND_LONG_MIN.
2019-09-23 13:08:44 +02:00
Nikita Popov 74876f09c4 Merge branch 'PHP-7.2' into PHP-7.3 2019-09-16 13:02:56 +02:00
Nikita Popov 8873df8e86 Fix leak in SplObjectStorage unserialization
The result of php_var_unserialize always needs to be destroyed,
even if the call failed.
2019-09-16 13:02:32 +02:00
Nikita Popov af324e24df Fix issue mentioned in #77302
Apparently Serializable::serialize() can return NULL, which is encoded
as N;. As we do not allow back-references to non-object values in
PHP 7.3 we need to make sure that any references are also compiled to
N;.
2019-02-21 12:04:49 +01:00
Guilliam Xavier b3935ed2af Fix tests bareword fallback with error suppression
(cherry picked from commit aad39879f2)
(cherry picked from commit 76f8a908bb)
2019-02-11 09:36:03 +01:00
Peter Kokot b746e69887 Sync leading and final newlines in *.phpt sections
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines in all
*.phpt sections.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-15 04:32:30 +02:00
Peter Kokot f1d7e3ca0b Sync leading and final newlines in *.phpt sections
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines in all
*.phpt sections.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-15 04:31:31 +02:00
Peter Kokot 782352c54a Trim trailing whitespace in *.phpt 2018-10-14 19:45:12 +02:00
Peter Kokot 17ccbeec32 Trim trailing whitespace in *.phpt 2018-10-14 19:44:14 +02:00
Nikita Popov d982bbe175 Fix ref ID handling when serializing $GLOBALS
This was already broken previously, but in PHP 7.3 stricter
validation during unserialization made this into an error.
2018-10-08 13:16:23 +02:00
Gabriel Caruso aac5cdc7d7 Remove superfluous SKIPIF sections of always available interfaces 2018-07-29 18:03:34 -03:00
Nikita Popov 2cc6922cbf Merge branch 'PHP-7.2' 2018-07-02 17:59:33 +02:00
Nikita Popov 3a236d0587 Merge branch 'PHP-7.1' into PHP-7.2 2018-07-02 17:59:15 +02:00
Nikita Popov 787593b708 Fix test after serialization change
And move it to a more appropriate location.
2018-07-02 17:58:26 +02:00
Nikita Popov a57b5e82a9 Merge branch 'PHP-7.2' 2018-07-02 17:30:07 +02:00
Nikita Popov 09bb2527e9 Merge branch 'PHP-7.1' into PHP-7.2 2018-07-02 17:29:32 +02:00
Nikita Popov c793885b76 Fixed bug #74670
Validate that "C" serialization payload is followed by "}" prior to
calling the unserialize() handler. This mitigates issues caused by
unserialize() not correctly handling strings that are not NUL
terminated. Making sure that there is a "}" at the end avoids the
problem.
2018-07-02 17:27:43 +02:00
Pedro Magalhães 13e9a471d7 Fix #76300 - Dont attempt to change visibility of a parent private 2018-06-17 15:53:55 -07:00
Stanislav Malyshev 7d7b7e801e Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix #76300 - Dont attempt to change visibility of a parent private
2018-06-17 15:47:06 -07:00
Pedro Magalhães 2dca8671e4 Fix #76300 - Dont attempt to change visibility of a parent private 2018-05-03 21:54:44 +01:00
Gabriel Caruso ded3d984c6 Use EXPECT instead of EXPECTF when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2018-02-20 21:53:48 +01:00
Nikita Popov 1a3bdb4a2c Remove some references to E_STRICT in tests
run-tests.php enforces error_reporting=E_ALL (including E_STRICT),
setting this explicitly in not necessary. Conversely, after the
removal of some E_STRICT errors, explicitly excluding it is no
longer necessary in some places.
2018-02-03 18:17:12 +01:00
Christoph M. Becker a0e5af70a7 Add missing SKIPIF section
The test requires the session extension, which may not be available, in
which case the test would fail, which is expected anyway, but not for
the expected reasons.
2018-02-03 13:34:58 +01:00
Dmitry Stogov f26fc527da Fixed unzserialize(), to disable creation of unsupported data structures through manually crafted strings. (Dmitry) 2017-10-13 15:53:11 +03:00
Anatol Belski 689f9956da Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix test failure on 32-bit
2017-09-12 18:19:34 +02:00
Anatol Belski fcad6a97b8 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix test failure on 32-bit
2017-09-12 18:18:44 +02:00
Anatol Belski 7674b5e574 Fix test failure on 32-bit 2017-09-12 18:17:28 +02:00
Anatol Belski 2f5129cacb Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix test portability
2017-09-11 12:40:11 +02:00
Anatol Belski d33194d2aa Fix test portability
The message comes from the C runtime, so it is not reliable to check the
exact wording.
2017-09-11 12:38:20 +02:00
Xinchen Hui 82d4727dbb Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #75152 (signed integer overflow in parse_iv)

Conflicts:
	ext/standard/var_unserializer.c
2017-09-11 12:47:47 +08:00
Xinchen Hui 6b2813c3a7 Fixed bug #75152 (signed integer overflow in parse_iv) 2017-09-11 12:46:11 +08:00
Dmitry Stogov 389ea45b12 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Made test 32/64-bit independent
2017-08-15 13:13:27 +03:00
Dmitry Stogov 3bc1226804 Made test 32/64-bit independent 2017-08-15 13:12:54 +03:00
Nikita Popov a871badf2a Merge branch 'PHP-7.1' into PHP-7.2 2017-08-12 13:17:24 +02:00
Nikita Popov 4fb7665c09 Merge branch 'PHP-7.0' into PHP-7.1 2017-08-12 13:15:48 +02:00
Nikita Popov 1a23ebc1ff Fixed bug #74103 and bug #75054
Directly fail unserialization when trying to acquire an r/R
reference to an UNDEF HT slot. Previously this left an UNDEF and
later deleted the index/key from the HT.

What actually caused the issue here is a combination of two
factors: First, the key deletion was performed using the hash API,
rather than the symtable API, such that the element was not actually
removed if it used an integral string key. Second, a subsequent
deletion operation, while collecting trailing UNDEF ranges, would
mark the element as available for reuse (leaving a corrupted HT
state with nNumOfElemnts > nNumUsed).

Fix this by failing early and dropping the deletion code.
2017-08-12 13:11:35 +02:00
Pedro Magalhães 7cb5bdf64a Fix #49649 - Handle property visibility changes on unserialization 2017-07-10 07:27:09 +01:00
Stanislav Malyshev d75dbb0e31 Merge branch 'PHP-7.1'
* PHP-7.1:
  Improve fix for #74145
  Fix wddx
  Fix tests
  Fixed bug #74111
  Fix bug #74603 - use correct buffer size
  Fix bug #74651 - check EVP_SealInit as it can return -1
  Update NEWS
  Fix bug #74087
  Fixed parsing of strange formats with mixed month/day and time strings
  Fix bug #74145 - wddx parsing empty boolean tag leads to SIGSEGV
  Fixed bug #74111
  Fix #74435: Buffer over-read into uninitialized memory
  Fix bug #74603 - use correct buffer size
  Fix bug #74651 - check EVP_SealInit as it can return -1
  Update NEWS
  Fix bug #73807
2017-07-04 21:23:16 -07:00
Stanislav Malyshev 0ba04f7737 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Improve fix for #74145
  Fix wddx
  Fix tests
  Fixed bug #74111
  Fix bug #74603 - use correct buffer size
  Fix bug #74651 - check EVP_SealInit as it can return -1
  Update NEWS
  Fix bug #74087
  Fixed parsing of strange formats with mixed month/day and time strings
  Fix bug #74145 - wddx parsing empty boolean tag leads to SIGSEGV
  Fixed bug #74111
  Fix #74435: Buffer over-read into uninitialized memory
  Fix bug #74603 - use correct buffer size
  Fix bug #74651 - check EVP_SealInit as it can return -1
  Update NEWS
  Fix bug #73807
2017-07-04 21:18:10 -07:00
Stanislav Malyshev 0496f5407f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Update NEWS
  Fix bug #74087
  Fixed parsing of strange formats with mixed month/day and time strings
  Fix bug #74145 - wddx parsing empty boolean tag leads to SIGSEGV
  Fixed bug #74111
  Fix #74435: Buffer over-read into uninitialized memory
  Fix bug #74603 - use correct buffer size
  Fix bug #74651 - check EVP_SealInit as it can return -1
  Update NEWS
  Fix bug #73807
2017-07-04 19:44:51 -07:00
Nikita Popov 3a25a56a92 Fixed bug #74111 2017-07-04 19:38:42 -07:00
Nikita Popov f8c514ba6b Fixed bug #74111 2017-07-04 19:06:16 -07:00
Remi Collet 1be0563087 Merge branch 'PHP-7.1'
* PHP-7.1:
  Adapt for 32-bits which fails at different offset (49 vs 38)
2017-07-04 20:27:10 +02:00