Commit Graph

83652 Commits

Author SHA1 Message Date
Stanislav Malyshev
6a7cc8ff85 Fix bug #73052 - Memory Corruption in During Deserialized-object Destruction 2016-09-12 21:04:23 -07:00
Stanislav Malyshev
7381d4c00e Add check in fgetcsv in case sizeof(unit) != sizeof(size_t) 2016-09-12 21:04:23 -07:00
Stanislav Malyshev
ecb7f58a06 Fix bug #73029 - Missing type check when unserializing SplArray 2016-09-12 21:04:23 -07:00
Stanislav Malyshev
b88393f08a Fix bug #72860: wddx_deserialize use-after-free 2016-09-12 21:04:23 -07:00
Stanislav Malyshev
65c8caafa8 Also fix overflow in wordwrap 2016-09-12 21:04:23 -07:00
Stanislav Malyshev
6d55ba2656 Fix bug #73007: add locale length check 2016-09-12 21:04:23 -07:00
Stanislav Malyshev
ba5ac0d360 Add more checks for int overflow 2016-09-12 21:04:23 -07:00
Stanislav Malyshev
223266e4e4 Fix bug #72928 - Out of bound when verify signature of zip phar in phar_parse_zipfile 2016-09-12 21:04:23 -07:00
Stanislav Malyshev
19866fb76c Fix various int size overflows.
Add function for detection of string zvals with length that does not fit
INT_MAX.
2016-09-12 21:04:23 -07:00
Adam Baratz
39f45e208c Add myself as pdo_dblib maintainer 2016-09-12 12:43:39 -04:00
Christoph M. Becker
0cbf634657 Skip regression test for issue that has not yet been released in libgd
<https://github.com/libgd/libgd/issues/177> has been assessed as enhancement,
so most likely it will be released with GD 2.3.
2016-09-12 13:21:34 +02:00
Christoph M. Becker
fcdc30b347 Skip test for external GD because of not yet published bugfix 2016-09-12 12:34:11 +02:00
Christoph M. Becker
6d0e773292 Skip tests for unpatched external libgd regarding libvpx
Some issues have never been fixed in the external libgd's libvpx binding,
so we skip the respective tests.
2016-09-11 23:49:09 +02:00
Christoph M. Becker
6ef987e012 Split test for bundled vs. external libgd
The behavior of imagecropauto($im, IMG_CROP_DEFAULT) is rather different
for the bundled and an external libgd, see
<https://github.com/libgd/libgd/issues/298>.
Therefore we split the test for now.
2016-09-11 19:30:55 +02:00
Christoph M. Becker
38455293f7 Make test case more resilient
This test case fails with external libgd, because libgd < 2.2.4 converts
palette images to truecolor (<https://github.com/libgd/libgd/issues/297>).

However, even if there happens no truecolor conversion, it is not guaranteed
that the palette indexes of the original and the cropped image are identical
(this is, for instance, not the case with current libgd master where the bug
has been fixed). Therefore we check for the expected RGBA value instead of
the palette index.
2016-09-11 18:29:27 +02:00
Christoph M. Becker
dc09f30933 A picture is worth a thousand message digests
The bundled GD test suites makes heavy use of md5() to verify the result
of drawing operations. This leads to fragile tests (even a slight change
in a PNG header would cause failure, and of course there is the
possibility of collisions), and even worse, eventual test failures are
rather unrevealing.

Therefore we replace all md5() verification with a simplistic
test_image_equals_file(), which is basically a simplified port of libgd's
gdTestImageCompareToFile(), adapted to the needs of PHPTs.

In the long run better tests helpers should be introduced (see also
<http://news.php.net/php.internals/94081>), but for now this solution
is preferable over the former.

(cherry picked from commit 24f9e96792)
2016-09-11 12:56:53 +02:00
Christoph M. Becker
326a4e38fb Add regression test for bug #73053
The test succeeds with libxml < 2.9.4, and is supposed to succeed with
libxml > 2.9.4. Unfortunately, we can't conditionally mark a test case
as XFAIL, so we're simply skipping the test for libxml 2.9.4 instead.
2016-09-11 00:06:45 +02:00
Anatol Belski
6c9d37d059 update NEWS 2016-09-10 11:02:17 +02:00
Anatol Belski
669fda00b7 Bug #73058 crypt broken when salt is 'too' long 2016-09-10 02:39:28 +02:00
Christoph M. Becker
c42a7f2f3f Remove ignored --FAIL-- section from test case
This is just confusing.
2016-09-09 16:27:50 +02:00
Christoph M. Becker
23e721fc93 Fix #73054: default option ignored when object passed to int filter
If an object that can't be converted to string is validated, we must not
bail out early, but rather check for a requested default value.
2016-09-09 14:30:24 +02:00
Levi Morrison
cb91a51b00 Partially fix bug #67167 - Wrong return value...
...from FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE

The remainer of the fix would require the filter functions to only
convert to string when it makes sense for that particular filter.

(cherry picked from commit 432dc527ad)
2016-09-09 12:45:46 +02:00
Yasuo Ohgaki
38553e853b Fixed Bug #68015 Session does not report invalid uid for files save handler 2016-09-09 11:31:54 +09:00
Anatol Belski
b1f33db39f backport 59444347 and 3d7343f6 2016-09-08 17:46:53 +02:00
Yasuo Ohgaki
8c700076d7 Fix bug26639.phpt 2016-09-08 14:07:57 +09:00
Yasuo Ohgaki
fb1c46f013 Update NEWS 2016-09-08 13:35:30 +09:00
Yasuo Ohgaki
8bbd0952e5 Fix Bug #72992 mbstring.internal_encoding doesn't inherit default_charset 2016-09-08 13:17:10 +09:00
Christoph M. Becker
5880428dac Fix potential memory issue with USE_ZEND_ALLOC=0
The PHP core and extensions are written with the assumption that memory
allocation either succeeds, or the allocator bails out (i.e. the allocator
is infallible). Therefore the result of emalloc() and friends are not checked
for NULL values.

However, with USE_ZEND_ALLOC=0, malloc() and friends are used as allocators,
but these are fallible, i.e. they return NULL instead of bailing out if they
fail. This easily leads to invalid memory accesses in the following, such as
in <https://bugs.php.net/73032>. Some of these cases may constitute
exploitable vulnerabilities.

Therefore we make the infallible __zend_alloc() and friends the default for
USE_ZEND_ALLOC=0.
2016-09-07 22:50:53 +02:00
Christoph M. Becker
dad793630d Fix #73025: Heap Buffer Overflow in virtual_popen of zend_virtual_cwd.c
`command_length` is retrieved via strlen() and later passed to emalloc()
and memcpy(), so the appropriate type is `size_t`.

We don't add a regression test, because that would need to allocate a string
of at least 2 GiB.
2016-09-06 12:05:58 +02:00
Yasuo Ohgaki
3a35d43ad9 Update NEWS 2016-09-06 18:29:20 +09:00
Yasuo Ohgaki
a25f6f89cd Fixed Bug #66964 mb_convert_variables() cannot detect recursion 2016-09-06 16:05:34 +09:00
Christoph M. Becker
8aad3131a1 Fix #70752: Depacking with wrong password leaves 0 length files
We should not open the output stream before we have tried to open the
archive entry, as failing the latter could leave an empty file behind.
2016-09-06 01:03:46 +02:00
Julien Pauli
dd6da58fac Updated NEWS 2016-09-05 17:03:29 +02:00
Keyur
0045d16863 Fixes #72590: Opcache restart with kill_all_lockers does not work
ACCEL_LOG_ERROR is special and causes a zend_bailout() and the code
never gets to call kill() in the next line after the logging. Change
the log level to WARNING.
2016-09-05 16:59:28 +02:00
Nikita Popov
b92cb6b238 Limit editorconfig to C code
PHPT files do not follow this.

[ci skip]
2016-09-05 14:22:13 +02:00
Julien Pauli
1abbcc8cc5 Updated NEWS 2016-09-05 10:17:56 +02:00
Julien Pauli
9834978a8b Fix #72972, Bad filter for the flags FILTER_FLAG_NO_RES_RANGE and FILTER_FLAG_NO_PRIV_RANGE 2016-09-05 10:08:42 +02:00
Richard Fussenegger
5c38fbe543 Added editorconfig file 2016-09-05 00:40:58 -07:00
Christoph M. Becker
39423e425d Implement #47456: Missing PCRE option 'J'
While it is possible to force the same behavior by setting the internal
option (?J), having a dedicated modifier appears to be useful. After all,
J is even listed on the "Pattern Modifiers" man page[1], but the description
referrs to (?J).

[1] <http://php.net/manual/en/reference.pcre.pattern.modifiers.php>
2016-09-05 00:30:48 -07:00
Stanislav Malyshev
cee363d609 Merge branch 'pull-request/2061' into PHP-5.6
* pull-request/2061:
  Recognize TDS versions 7.3 and 7.4
2016-09-05 00:29:11 -07:00
Adam Baratz
84d495055d Use integer placeholders, since values can vary with the TDS version 2016-09-05 00:17:59 -07:00
Stanislav Malyshev
b578580e88 Same issue as #72926 in another place. 2016-09-04 20:49:34 -07:00
Stanislav Malyshev
d1fbc98ff6 Sync fix for bug #72910 with current upstream 2016-09-04 19:13:48 -07:00
Christoph M. Becker
b7259b71b4 Fix #72994: mbc_to_code() out of bounds read
We're backporting commit 999a3553 to the still supported PHP 5.6.
2016-09-04 16:37:06 +02:00
Christoph M. Becker
d582241368 Fix #67325: imagetruecolortopalette: white is duplicated in palette
gdImageTrueColorToPalette() is sometimes wasteful by putting multiple white
color entries into the palette. This is caused by an obvious typo, where
to avoid a division by zero when `total` is zero, `count` is checked instead
of `total`.

We fix this issue to improve the quality of the color quantization.

Cf. <https://github.com/libgd/libgd/commit/24b4550f>
2016-09-03 19:50:42 +02:00
Anatol Belski
9513187dee fix leak and error check order 2016-09-03 16:59:17 +02:00
Christoph M. Becker
bca913d70a Fix proto comment
While we're at it, we also change a related comment to use American English
consistently.
2016-09-03 13:41:29 +02:00
Christoph M. Becker
c83bdb8e6a Make test case more resilient
When ran from a root directory the test case failed, because the open_basedir
restriction for "../[…]" won't kick in. Therefore we change the current
working directory to the test case's directory, as discussed on internals,
see <http://news.php.net/php.internals/95585>.
2016-09-03 00:24:30 +02:00
Anatol Belski
5efd2a33df fix double free 2016-09-03 00:01:04 +02:00
Stanislav Malyshev
e576714f6b Fix bug #72910
Merge upstream patch from 65bdf2a0d1
2016-09-01 23:27:06 -07:00