1
0
mirror of https://github.com/php/php-src.git synced 2026-04-24 08:28:26 +02:00
Commit Graph

11318 Commits

Author SHA1 Message Date
Nikita Popov 19e6abebc7 Check for object_init_ex() failure in user filter factory 2019-10-07 17:52:29 +02:00
Christoph M. Becker abaf9a76dc Fix #78620: Out of memory error
The integer addition in `ZEND_MM_ALIGNED_SIZE_EX` can overflow, what we
have to catch early.
2019-10-04 09:08:01 +02:00
Konstantin Kopachev 05560b67bc Fix #76859 stream_get_line skips data if used with data-generating filter
stream_get-line repeatedly calls php_stream_fill_read_buffer until
enough data is accumulated in buffer. However, when stream contains
filters attached to it, then each call to fill buffer essentially
resets buffer read/write pointers and new data is written over old.
This causes stream_get_line to skip parts of data from stream
This patch fixes such behavior, so fill buffer call will append.
2019-10-03 06:50:43 +02:00
Fabien Villepinte 209e37db7d Add missing skip keyword in tests 2019-10-01 11:13:36 +02:00
Nikita Popov 6fcde56b03 Fixed bug #78612 2019-09-30 15:06:07 +02:00
Nikita Popov 3ddb63dce1 Fix skipif condition 2019-09-23 17:17:52 +02:00
Nikita Popov bc4c4c658c Skip test on 32-bit 2019-09-23 16:42:24 +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 175f4f24ae Increase timeout in test 2019-09-17 17:33:46 +02:00
fancyweb e691a98c1f Fix #76342: file_get_contents waits twice specified timeout 2019-09-17 15:42:29 +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
Christoph M. Becker 81cefab7b0 Stick with zend_long for ABI compatibility
Cf. <https://github.com/php/php-src/pull/4700#issuecomment-531515689>.
2019-09-15 15:11:25 +02:00
bugreportuser fdcca93056 Fix #78535: auto_detect_line_endings value not parsed as bool 2019-09-14 18:46:09 +02:00
Nikita Popov 16d35eb643 Fix overflow in memory limit checks
Due to overflows in the memory limit checks, we were missing cases
where the allocation size was close to the address space size, and
caused an OOM condition rather than a memory limit error.
2019-08-26 10:25:30 +02:00
Christoph M. Becker 81f52158b4 Fix #78220: Can't access OneDrive folder
As of Windows 1903, when the OneDrive on-demand feature is enabled, the
OneDrive folder is reported as reparse point by `FindFirstFile()`, but
trying to get information about the reparse point using
`DeviceIoControl()` fails with `ERROR_NOT_A_REPARSE_POINT`.  We work
around this problem by falling back to `GetFileInformationByHandle()`
if that happens, but only if the reparse point is reported as cloud
reparse point, and only if PHP is running on Windows 1903 or later.

The patch has been developed in collaboration with ab@php.net.

We should keep an eye on the somewhat quirky OneDrive behavior, since
it might change again in a future Windows release.
2019-08-19 19:55:35 +02:00
Albert Casademont dc7aa22b18 Fix bug #78326
Similar to what fread() does, truncate the stream_get_contents()
result if the original buffer was way too large.
2019-07-29 17:33:57 +02:00
Nikita Popov b864abfe23 Fixed bug #69100 2019-07-17 15:58:29 +02:00
Remi Collet eab0079c90 Fix #78269 password_hash uses weak options for argon2 2019-07-15 14:10:38 +02:00
Christoph M. Becker 44c8b7414c Fix #78241: touch() does not handle dates after 2038 in PHP 64-bit
`time_t` defaults to `_time64` (which is 64bit signed) even on x86, but
`Int32x32To64()` truncates it to signed 32bit.  We replace the macro
with the "manual" calculation.
2019-07-03 09:59:17 +02:00
Nikita Popov 7d28a24c66 Remove stream_socket_sendto.phpt
Fails for me locally due to different number of warnings with
different messages. Rather than adding more wildcards I'm dropping
this test entirely, as it doesn't seem to test anything particularly
useful.

(cherry picked from commit 84333cad67)
2019-06-26 16:58:37 +02:00
Joe Watkins 31a1c1e67c fix setcookie Max-Age to use php_time 2019-06-19 12:42:00 +02:00
Christoph M. Becker f3ff72e54b Fix #77937: preg_match failed
On some recent Windows systems, ext\pcre\tests\locales.phpt fails,
because 'pt_PT' is accepted by `setlocale()`, but not properly
supported by the ctype functions, which are used internally by PCRE2 to
build the localized character tables.

Since there appears to be no way to properly check whether a given
locale is fully supported, but we want to minimize BC impact, we filter
out typical Unix locale names, except for a few cases which have
already been properly supported on Windows.  This way code like

  setlocale(LC_ALL, 'de_DE.UTF-8', 'de_DE', 'German_Germany.1252');

should work like on older Windows systems.

It should be noted that the locale names causing trouble are not (yet)
documented as valid names anyway, see
<https://docs.microsoft.com/en-us/cpp/c-runtime-library/locale-names-languages-and-country-region-strings?view=vs-2019>.
2019-06-11 08:42:32 +02:00
Dmitry Stogov 83cdb89f8a Fixed bug #77135 (Extract with EXTR_SKIP should skip $this) 2019-06-07 11:36:39 +03:00
Holly Li (WIPRO LIMITED) 202e6936d6 use {TMP} placeholder in phpt tests 2019-05-21 09:02:37 +02:00
Christoph M. Becker 7ddfe73e69 Fix #77940: test using outdated mon_thousands_sep for Swedish
Of course, we should expect a comma, not a period.
2019-04-25 23:28:41 +02:00
Christoph M. Becker bfbfb9dabd Fix #77940: test using outdated mon_thousands_sep for Swedish
This time so that it works for all Windows 10 versions (hopefully).
2019-04-25 19:39:42 +02:00
Christoph M. Becker 37ca6a7a2a Fix #77940: test using outdated mon_thousands_sep for Swedish 2019-04-25 08:58:13 +02:00
Christoph M. Becker fe202d99c8 Fix #77938: socket_get_option error
Since tcp_socket/ssl streams are not representable, we suppress the
redirect to fix the test case.
2019-04-25 00:03:45 +02:00
twosee bdac9ef10d Preserve keys in emulate_read_fd_set()
Keys are already preserved in the non-emulated case.
2019-04-08 12:58:46 +02:00
Nikita Popov d7b5954f28 Fixed bug #77853 2019-04-08 11:40:50 +02:00
Nikita Popov eea61cda7d Fixed bug #77844
We should probably return an integer result from the operation in
typed mode, right now the result is always a string.
2019-04-08 11:11:58 +02:00
Stanislav Malyshev d1d692abe7 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Always use ZEND_SECURE_ZERO() when cleaning up data
  bump versions after release
2019-04-06 19:05:37 -07:00
Stanislav Malyshev 588db7cecf Always use ZEND_SECURE_ZERO() when cleaning up data
Optimizing compilers have an annoying tendency to throw out
memsets over data that they think aren't used anymore. Apply secure
zero-out in cases where this has potential to happen.
2019-04-06 18:15:42 -07:00
Christoph M. Becker 0aa1a2c833 Fix test expectation
The `W32_SM_SENDMAIL_FROM_MALFORMED` error message will only be shown
if the `$additional_headers` parameter is passed to `mail`, which is
not the case for this test.  Instead we have to expect `BAD_MSG_RPATH`.
2019-03-29 09:55:04 +01:00
Vlad Temian ec2ecb7e12 Fix bug #77680: Correctly implement recursive mkdir on FTP stream
If the root directory was missing, an extra CWD without arguments was
made. Also, the MKD contained an empty string.

Now the CWD will use / and MKDs will be issued starting from the root
directory.
2019-03-25 17:43:46 +01:00
Remi Collet 2e9dccef78 ensure pcre.jit=1 for these tests 2019-03-22 15:00:31 +01:00
Remi Collet a467a89f16 Fix tests after fix for #76717 2019-03-20 14:07:26 +01:00
Vlad Temian fe2885d80a Fixed bug #77765
Set mode 40755 for directories, via FTP stream stat.

Because we already manage to CWD into the current directory,
we should set 40755 as mode, instead of 40644.
2019-03-19 10:02:38 +01:00
Nikita Popov 1fd32e9c2f Fixed bug #76717
Print INT_MIN as -INT_MAX-1 to avoid it getting parsed as a float
literal due to integer overflow.
2019-03-11 15:35:02 +01:00
Nikita Popov 9ad9cc71ff Fixed bug #77669 2019-02-28 09:58:01 +01:00
Xinchen Hui 4a72dd782d Fixed bug #77664 (Segmentation fault when using undefined constant in custom wrapper) 2019-02-25 14:41:46 +08:00
DanielCiochiu 07877c46e3 Fixed bug #75546
By respecting the SILENT flag when checking the visibility of a
class constant.
2019-02-12 11:42:33 +01:00
Nikita Popov 8e34de4756 Fixed bug #77608
Remove special handling of doubles and escape them as usual instead.
2019-02-12 10:49:20 +01:00
johnstevenson fe4d7248cc Fix #77552: Uninitialized buffer in stat functions 2019-02-11 11:31:55 +01:00
Lauri Kenttä dbe7f2a41a Fix seeking in php://input 2019-01-18 12:44:47 +01:00
Nikita Popov 5d33024a5d Fixed bug #77439 2019-01-10 10:57:04 +01:00
Stanislav Malyshev fe820fcba6 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #77369 - memcpy with negative length via crafted DNS response
  Fix more issues with encodilng length
  Fix #77270: imagecolormatch Out Of Bounds Write on Heap
  Fix bug #77380  (Global out of bounds read in xmlrpc base64 code)
  Fix bug #77371 (heap buffer overflow in mb regex functions - compile_string_node)
  Fix bug #77370 - check that we do not read past buffer end when parsing multibytes
  Fix #77269: Potential unsigned underflow in gdImageScale
  Fix bug #77247 (heap buffer overflow in phar_detect_phar_fname_ext)
  Fix bug #77242 (heap out of bounds read in xmlrpc_decode())
  Regenerate certs for openssl tests
2019-01-06 11:57:16 -08:00
Stanislav Malyshev 8d3dfabef4 Fix #77369 - memcpy with negative length via crafted DNS response 2019-01-06 11:39:09 -08:00
Xinchen Hui 8ebae84674 Fixed bug #77395 (segfault about array_multisort) 2019-01-02 12:09:47 +08:00
Anatol Belski 54a2b42778 Increase timeout for test on AppVeyor 2018-12-29 17:48:25 +01:00