Commit Graph

1727 Commits

Author SHA1 Message Date
Stanislav Malyshev
76c02dcdf7 Merge branch 'PHP-7.1'
* PHP-7.1:
  Fix #73549: Use after free when stream is passed to imagepng
2016-11-27 14:54:19 -08:00
Stanislav Malyshev
8cc42537d2 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix #73549: Use after free when stream is passed to imagepng
2016-11-27 14:53:39 -08:00
Stanislav Malyshev
1cb58ead70 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix #73549: Use after free when stream is passed to imagepng
2016-11-27 14:53:27 -08:00
Christoph M. Becker
5049ef2f1c Fix #73549: Use after free when stream is passed to imagepng
If a stream is passed to imagepng() or other image output functions,
opposed to a filename, we must not close this stream.
2016-11-27 14:51:02 -08:00
Christoph M. Becker
a35359f8b7 Merge branch 'PHP-7.1' 2016-11-25 23:33:02 +01:00
Christoph M. Becker
51ba53ed0f Merge branch 'PHP-7.0' into PHP-7.1 2016-11-25 23:27:13 +01:00
Christoph M. Becker
bc979aee6d Merge branch 'PHP-5.6' into PHP-7.0 2016-11-25 23:16:18 +01:00
Christoph M. Becker
7f529e3dee Fix #73582: Failing ext/gd/tests/imagettftext_charmap_order.phpt
This test is not supposed to work with JIS-mapped Japanese font support
enabled.
2016-11-25 23:14:08 +01:00
Nikita Popov
5af586bec5 Remove more PHP 6 leftovers from tests 2016-11-24 22:39:39 +01:00
Anatol Belski
bfb9be9bd4 Merge branch 'PHP-7.1'
* PHP-7.1:
  remove TSRMLS_*
2016-11-22 00:33:29 +01:00
Anatol Belski
d61db8d602 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  remove TSRMLS_*
2016-11-22 00:32:42 +01:00
Anatol Belski
5e9b4c26a5 remove TSRMLS_* 2016-11-21 23:53:37 +01:00
Nikita Popov
45f7b2bcc8 Fix CRLF line-endings in tests
Also fix a single instance of CRLF in ibase_query.c.
2016-11-20 22:31:24 +01:00
Christoph M. Becker
189bbb586c Merge branch 'pull-request/2164' 2016-11-13 23:31:40 +01:00
Anatol Belski
a75827b4f9 Merge branch 'PHP-7.1'
* PHP-7.1:
  Fixed bug #73418 Integer Overflow in "_php_imap_mail" leads to crash
  Fixed bug #73418 Integer Overflow in "_php_imap_mail" leads to crash
  Fix #72696: imagefilltoborder stackoverflow on truecolor images
  Fix #72482: Ilegal write/read access caused by gdImageAALine overflow
  Fix bug #73144 and bug #73341 - remove extra dtor
  remove unreferenced var came in with merge
  Fix bug #73331 - do not try to serialize/unserialize objects wddx can not handle
  Fix #72696: imagefilltoborder stackoverflow on truecolor images
  Fix #72482: Ilegal write/read access caused by gdImageAALine overflow
  fix version
  set versions
  Fix bug #73144 and bug #73341 - remove extra dtor
  Fix bug #73331 - do not try to serialize/unserialize objects wddx can not handle
2016-11-08 11:16:55 +01:00
Anatol Belski
9b81342352 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #73418 Integer Overflow in "_php_imap_mail" leads to crash
  Fixed bug #73418 Integer Overflow in "_php_imap_mail" leads to crash
  Fix #72696: imagefilltoborder stackoverflow on truecolor images
  Fix #72482: Ilegal write/read access caused by gdImageAALine overflow
  Fix bug #73144 and bug #73341 - remove extra dtor
  remove unreferenced var came in with merge
  Fix bug #73331 - do not try to serialize/unserialize objects wddx can not handle
  Fix #72696: imagefilltoborder stackoverflow on truecolor images
  Fix #72482: Ilegal write/read access caused by gdImageAALine overflow
  fix version
  set versions
  Fix bug #73144 and bug #73341 - remove extra dtor
  Fix bug #73331 - do not try to serialize/unserialize objects wddx can not handle
2016-11-08 11:15:06 +01:00
Anatol Belski
2b30b54275 Merge remote-tracking branch 'phpsec/PHP-7.0.13' into PHP-7.0
* phpsec/PHP-7.0.13:
  Fixed bug #73418 Integer Overflow in "_php_imap_mail" leads to crash
  Fix #72696: imagefilltoborder stackoverflow on truecolor images
  Fix #72482: Ilegal write/read access caused by gdImageAALine overflow
  Fix bug #73144 and bug #73341 - remove extra dtor
  remove unreferenced var came in with merge
  Fix bug #73331 - do not try to serialize/unserialize objects wddx can not handle
  fix version
  set versions
2016-11-08 11:13:29 +01:00
Anatol Belski
33766347cb Merge remote-tracking branch 'phpsec/PHP-5.6.28' into PHP-5.6 2016-11-08 11:06:52 +01:00
Christoph M. Becker
5693474997 Fix #72696: imagefilltoborder stackoverflow on truecolor images
We must not allow negative color values be passed to
gdImageFillToBorder(), because that can lead to infinite recursion
since the recursion termination condition will not necessarily be met.

(cherry picked from commit 863d37ea66)
2016-11-01 13:07:37 +01:00
Christoph M. Becker
1b5543b8ab Fix #72482: Ilegal write/read access caused by gdImageAALine overflow
Instead of rolling our own bounds check we use clip_1d() as it's done
in gdImageLine() and in external libgd. We must not pass the image
width and height, respectively, but rather the largest ordinate value
that is allowed to be accessed, i.e. width-1 and height-1,
respectively.

(cherry picked from commit 6499581af7)
2016-11-01 13:03:41 +01:00
Christoph M. Becker
863d37ea66 Fix #72696: imagefilltoborder stackoverflow on truecolor images
We must not allow negative color values be passed to
gdImageFillToBorder(), because that can lead to infinite recursion
since the recursion termination condition will not necessarily be met.
2016-10-30 14:31:29 -07:00
Christoph M. Becker
6499581af7 Fix #72482: Ilegal write/read access caused by gdImageAALine overflow
Instead of rolling our own bounds check we use clip_1d() as it's done
in gdImageLine() and in external libgd. We must not pass the image
width and height, respectively, but rather the largest ordinate value
that is allowed to be accessed, i.e. width-1 and height-1,
respectively.
2016-10-30 14:28:23 -07:00
Christoph M. Becker
c8c8c0b52c Merge branch 'PHP-7.1' 2016-10-25 14:41:00 +02:00
Christoph M. Becker
c30e5a32c1 Merge branch 'PHP-7.0' into PHP-7.1 2016-10-25 14:35:38 +02:00
Christoph M. Becker
af4bfe234c Merge branch 'PHP-5.6' into PHP-7.0 2016-10-25 14:31:41 +02:00
Christoph M. Becker
cd13d0260a Fix #72494: imagecropauto out-of-bounds access
This issue has actually already been fixed with commit 46f2c690. We're
adding a regression test and a NEWS entry, and also port the fix in
gdImageCropThreshold() from libgd:
  * <https://github.com/libgd/libgd/commit/b347e034>
  * <https://github.com/libgd/libgd/commit/46f2c690>
2016-10-25 14:29:48 +02:00
Joe Watkins
e0b6ac2976 Merge branch 'pull-request/2135' 2016-10-20 05:33:12 +01:00
Christoph M. Becker
371f41250c Remove superfluous checks for PNG support
PNG support is required to build ext/gd, so there's no need to check
for it in the tests.
2016-10-18 14:17:37 +02:00
Christoph M. Becker
209d4220d5 Add PHP bindings for setting and getting the image resolution
We expose the image resolution related GD functionality to userland
by introducing `imageresolution()` as getter/setter. Given only the
image argument, it returns the current resolution as indexed array.
Given only a second argument, it sets the horizontal and vertical
resolution to this value. Given three arguments, it sets the horizontal
and vertical resolution to the given arguments, respectively.
2016-10-18 01:53:39 +02:00
Christoph M. Becker
0f49aa3287 Merge branch 'pull-request/2151' 2016-10-17 10:37:38 +02:00
Christoph M. Becker
1aaa560d85 Mark functions as PHP_DEP_FE instead of manually emitting the notice 2016-10-15 23:41:33 +02:00
Christoph M. Becker
1490446ce0 RFC: Deprecate png2wbmp() and jpegwbmp()
See <https://wiki.php.net/rfc/deprecate-png-jpeg-2wbmp>.
2016-10-15 16:16:34 +02:00
Christoph M. Becker
0864915550 Fix #73280: Stack Buffer Overflow in GD dynamicGetbuf
We make sure to never pass a negative `rlen` as size to memcpy().

Cf. <https://github.com/libgd/libgd/commit/53110871>.

(cherry picked from commit cc08cbc84d)
2016-10-14 02:02:42 +02:00
Christoph M. Becker
c31eb5a407 Remove unused code
There is no gif2wbmp() or such, and it is highly unlikely that it'll be
ever added, so we remove the unused code.
2016-10-13 15:35:10 +02:00
Anatol Belski
19605950fc add missing header for gd_error 2016-10-13 14:40:37 +02:00
Anatol Belski
fa45124138 fix syslog interference 2016-10-13 14:40:37 +02:00
Christoph M. Becker
a9209588d5 Merge branch 'PHP-7.0' into PHP-7.1 2016-10-13 11:31:37 +02:00
Christoph M. Becker
b8fab503fe Merge branch 'PHP-5.6' into PHP-7.0 2016-10-13 11:25:11 +02:00
Christoph M. Becker
cc08cbc84d Fix #73280: Stack Buffer Overflow in GD dynamicGetbuf
We make sure to never pass a negative `rlen` as size to memcpy().

Cf. <https://github.com/libgd/libgd/commit/53110871>.
2016-10-13 11:10:02 +02:00
Christoph M. Becker
4be36b536e Merge branch 'PHP-7.1' 2016-10-10 12:13:07 +02:00
Christoph M. Becker
0f40ca989a Merge branch 'PHP-7.0' into PHP-7.1 2016-10-10 12:12:13 +02:00
Christoph M. Becker
fb08216b08 Merge branch 'PHP-5.6' into PHP-7.0 2016-10-10 11:45:53 +02:00
Christoph M. Becker
fc989fc6e7 Fix #73279: Integer overflow in gdImageScaleBilinearPalette()
The color components are supposed to be in range 0..255, so we must not
cast them to `signed char`, what can be the default for `char`.

Port of <https://github.com/libgd/libgd/commit/77c8d359>.
2016-10-10 11:41:39 +02:00
Christoph M. Becker
7ce90014e2 Merge branch 'PHP-7.1' 2016-10-09 15:27:14 +02:00
Christoph M. Becker
a16f0c5e01 Merge branch 'PHP-7.0' into PHP-7.1 2016-10-09 15:21:40 +02:00
Christoph M. Becker
c930714cbe Merge branch 'PHP-5.6' into PHP-7.0 2016-10-09 15:14:17 +02:00
Christoph M. Becker
b92216b97d Fix #73272: imagescale() affects imagesetinterpolation()
We must not permanently change the interpolation method, but rather
have to restore the old method after we're done with scaling the image.
2016-10-09 15:10:34 +02:00
Christoph M. Becker
432e16cb58 Unify error handling of bundled and external libgd
There's no need anymore to call an own error handler directly. Instead we
register our error handler and call libgd's error functions (which will
forward). We do this regardless of compiling with the bundled or an external
libgd.
2016-10-07 01:13:49 +02:00
Christoph M. Becker
2b134a1dcb Move freeing of truecolor pixels to a function
We port <https://github.com/libgd/libgd/commit/81675d39>.
2016-10-03 12:11:46 +02:00
Christoph M. Becker
ec591b555f Change gdImageTrueColorToPalette() to return success/failure
We're porting the relevant changes from
<https://github.com/libgd/libgd/commit/34a00a40>.

We also check the return value in the PHP binding, and throw E_WARNING if
the conversion failed.
2016-10-03 12:02:31 +02:00