Commit graph

1527 commits

Author SHA1 Message Date
Christoph M. Becker
3d0002ed36 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-02 18:56:35 +02:00
Christoph M. Becker
3a8c027ec3 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-02 18:49:59 +02:00
Christoph M. Becker
f5622f5c87 Fix #72709: imagesetstyle() causes OOB read for empty $styles
Calling imagesetstyle() with an empty $styles array caused gdImageSetStyle()
to be called with `noOfPixels==0`, what could have lead to OOB reads.
Actually, this issue will be fixed in libgd, but to avoid issues when older
libgd is in use, we simply disallow passing an empty $styles array to
imagesetstyle(), what wouldn't serve a useful purpose anyway.
2016-08-02 18:43:37 +02:00
Christoph M. Becker
387847a0b2 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-25 02:03:54 +02:00
Christoph M. Becker
138fea83fe Merge branch 'PHP-5.6' into PHP-7.0
# Resolved conflicts:
#	ext/gd/tests/gd_info_variation1.phpt
2016-07-25 02:02:54 +02:00
Christoph M. Becker
305bddb0ed Fix broken test case
d28f1da introduced a test regression, due to potentially additional output
regarding FreeType support. We fix that by making the test more resilient.
2016-07-25 02:00:37 +02:00
Christoph M. Becker
d55a773223 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-25 00:25:11 +02:00
Christoph M. Becker
4db4997ac5 Merge branch 'PHP-5.6' into PHP-7.0
# Resolved conflicts:
#	ext/gd/tests/gd_info_variation1.phpt
2016-07-25 00:16:21 +02:00
Christoph M. Becker
d28f1dae9d Fix broken test case
The test claims that it would be "checking all the values in returned array",
but due to the use of %a it actually skipped elements. We fix that by using
%s instead.
2016-07-25 00:13:44 +02:00
Christoph M. Becker
8aa9ddb4d2 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-23 19:38:45 +02:00
Christoph M. Becker
2c0a18480d Merge branch 'PHP-5.6' into PHP-7.0 2016-07-23 19:36:53 +02:00
Christoph M. Becker
88838dd282 Fix #68712: suspicious if-else statements 2016-07-23 19:29:43 +02:00
Christoph M. Becker
88bc54d3dc Merge branch 'PHP-7.0' into PHP-7.1 2016-07-23 18:13:29 +02:00
Christoph M. Becker
03ccd42b18 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-23 18:12:14 +02:00
Christoph M. Becker
9fbd0c1ff1 Fix copy&paste errors in gd_interpolation.c
According to <f101380>.
2016-07-23 18:09:18 +02:00
Christoph M. Becker
03eeea4aa5 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-23 16:57:12 +02:00
Christoph M. Becker
5056d59f96 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-23 16:55:16 +02:00
Christoph M. Becker
2c16b9cf62 Fix #66555: Always false condition in ext/gd/libgd/gdkanji.c
This issue has already been fixed in libgd[1], so we fix PHP's bundled
libgd accordingly.

[1] <aa1d71c>
2016-07-23 16:48:07 +02:00
Christoph M. Becker
f3a89ff075 Add test case for imagecopyresampled() with alpha 2016-07-20 19:26:29 +02:00
Stanislav Malyshev
dda0ea9b3a Merge branch 'PHP-7.0'
* PHP-7.0:
  Improve fix for #72520
  #72482, revert for 5.6 for now
2016-07-19 22:38:54 -07:00
Stanislav Malyshev
df5ee7bc25 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Improve fix for #72520
  #72482, revert for 5.6 for now

Conflicts:
	ext/zip/zip_stream.c
2016-07-19 22:38:35 -07:00
Pierre Joye
e8b768dd92 Merge branch 'PHP-5.6' of git.php.net:php-src into PHP-5.6 2016-07-20 00:18:56 +07:00
Pierre Joye
9cc0a5a9a9 #72482, revert for 5.6 for now 2016-07-20 00:18:25 +07:00
Christoph M. Becker
604a2a20a4 Merge branch 'PHP-7.0' 2016-07-19 17:50:45 +02:00
Christoph M. Becker
8466155ff5 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-19 17:41:16 +02:00
Christoph M. Becker
828f911efd Fix #43828: broken transparency of imagearc for truecolor in blendingmode
No pixel of a filled arc must ever be drawn multiple times. Otherwise we get
artifacts regarding transparency. That happens with the current
implementation of gdImageFilledArc() unless gdChord or gdNoFill are set.
When gdPie is set, however, the filled arc is drawn in wedges, which are
polygons of three points, and so some overlap is natural.

To resolve the issue, we stick with the current algorithm of calculating the
wedges, but instead of drawing each polygon separately, we put the relevant
points in a large array, and draw a single polygon. That also is supposed to
improve the performance considerably.

Note that this modification will change the results when gdImageSetStyle()
or gdImageSetBrush() are used, but we believe that this modification is also
an improvement in this regard, even though it still might not make much
sense to use these functions with gdImageFilledArc().

The respective fix for libgd is
<e7e20d6>.
2016-07-19 17:38:26 +02:00
Pierre Joye
439e2ae516 Merge branch 'PHP-7.0'
* PHP-7.0:
  #72482, Ilegal write/read access caused by gdImageAALine overflow
  fix #72494, improve input color check and prevent issues when old gd are used, done before gd call
  improve fix #72558, free contribRow as well
2016-07-19 19:35:40 +07:00
Pierre Joye
77a71cba20 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  #72482, Ilegal write/read access caused by gdImageAALine overflow
2016-07-19 19:34:51 +07:00
Pierre Joye
b25009fc2c #72482, Ilegal write/read access caused by gdImageAALine overflow 2016-07-19 19:34:07 +07:00
Pierre Joye
2767d1953f merge conflict 2016-07-19 18:55:09 +07:00
Pierre Joye
1d69028d2f fix #72494, improve input color check and prevent issues when old gd are used, done before gd call 2016-07-19 18:23:51 +07:00
Pierre Joye
1e9273c48b Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  improve fix #72558, free contribRow as well
2016-07-19 16:33:38 +07:00
Pierre Joye
48e76abadd improve fix #72558, free contribRow as well 2016-07-19 16:33:17 +07:00
Stanislav Malyshev
83d498dafd Merge branch 'PHP-7.0'
* PHP-7.0:
  improve fix #72558, while (u>=0) with unsigned int will always be true
  improve fix #72558, while (u>=0) with unsigned int will always be true
2016-07-19 01:57:08 -07:00
Stanislav Malyshev
caa96c4416 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  improve fix #72558, while (u>=0) with unsigned int will always be true
  improve fix #72558, while (u>=0) with unsigned int will always be true
2016-07-19 01:56:57 -07:00
Pierre Joye
bc8c722cb4 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  improve fix #72558, while (u>=0) with unsigned int will always be true
2016-07-19 15:53:25 +07:00
Pierre Joye
df09515089 improve fix #72558, while (u>=0) with unsigned int will always be true 2016-07-19 15:51:43 +07:00
Stanislav Malyshev
b2b44c0f0e Merge branch 'PHP-7.0'
* PHP-7.0:
  Fix memory leak
2016-07-19 01:47:59 -07:00
Stanislav Malyshev
9698082306 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix memory leak
2016-07-19 01:47:48 -07:00
Stanislav Malyshev
f69362d212 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix memory leak
2016-07-19 01:47:40 -07:00
Stanislav Malyshev
47d6ea6332 Fix memory leak 2016-07-19 01:47:27 -07:00
Stanislav Malyshev
70d6ce3368 Merge branch 'PHP-7.0'
* PHP-7.0: (27 commits)
  fix #72519, possible OOB using imagegif
  fix #72512, invalid read or write for palette image when invalid transparent index is used
  Apparently some envs miss SIZE_MAX
  Fix tests
  Fix bug #72618: NULL Pointer Dereference in exif_process_user_comment
  Partial fix for bug #72613 - do not allow reading past error read
  Partial fix for bug #72613 - do not treat negative returns from bz2 as size_t
  Fix bug #72606: heap-buffer-overflow (write) simplestring_addn simplestring.c
  Fix for bug #72558, Integer overflow error within _gdContributionsAlloc()
  Fix bug #72603: Out of bound read in exif_process_IFD_in_MAKERNOTE
  update NEWS
  Fixed bug #72570 Segmentation fault when binding parameters on a query without placeholders
  Fix bug #72562 - destroy var_hash properly
  Fix bug #72551 and bug #72552 - check before converting size_t->int
  Fix bug #72541 - size_t overflow lead to heap corruption
  Fix bug #72533 (locale_accept_from_http out-of-bounds access)
  Fix fir bug #72520
  Fix for bug #72513
  Fix for bug #72513
  CS fix and comments with bug ID
  ...

Conflicts:
	ext/standard/basic_functions.c
2016-07-19 01:44:14 -07:00
Stanislav Malyshev
b00f8f2a5b Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix #72519, possible OOB using imagegif
  fix #72512, invalid read or write for palette image when invalid transparent index is used
  Apparently some envs miss SIZE_MAX
  Fix tests
  Fix bug #72618: NULL Pointer Dereference in exif_process_user_comment
  Partial fix for bug #72613 - do not treat negative returns from bz2 as size_t
  Fix bug #72606: heap-buffer-overflow (write) simplestring_addn simplestring.c
  Fix for bug #72558, Integer overflow error within _gdContributionsAlloc()
  Fix bug #72603: Out of bound read in exif_process_IFD_in_MAKERNOTE
  Fix bug #72562 - destroy var_hash properly
  Fix bug #72533 (locale_accept_from_http out-of-bounds access)
  Fix fir bug #72520
  Fix for bug #72513
  Fix for bug #72513
  CS fix and comments with bug ID
  Fix for HTTP_PROXY issue.
  5.6.24RC1
  add tests for bug #72512
  Fixed bug #72512 gdImageTrueColorToPaletteBody allows arbitrary write/read access
  Fixed bug #72479 - same as #72434

Conflicts:
	Zend/zend_virtual_cwd.c
	ext/bz2/bz2.c
	ext/exif/exif.c
	ext/session/session.c
	ext/snmp/snmp.c
	ext/standard/basic_functions.c
	main/SAPI.c
	main/php_variables.c
2016-07-19 01:39:28 -07:00
Stanislav Malyshev
4d0565b5ba Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix #72519, possible OOB using imagegif
  fix #72512, invalid read or write for palette image when invalid transparent index is used
  Apparently some envs miss SIZE_MAX
  Fix tests
  Fix bug #72618: NULL Pointer Dereference in exif_process_user_comment
  Partial fix for bug #72613 - do not treat negative returns from bz2 as size_t
  Fix bug #72606: heap-buffer-overflow (write) simplestring_addn simplestring.c
  Fix for bug #72558, Integer overflow error within _gdContributionsAlloc()
  Fix bug #72603: Out of bound read in exif_process_IFD_in_MAKERNOTE
  Fix bug #72562 - destroy var_hash properly
  Fix bug #72533 (locale_accept_from_http out-of-bounds access)
  Fix fir bug #72520
  Fix for bug #72513
  CS fix and comments with bug ID
  Fix for HTTP_PROXY issue.
  add tests for bug #72512
  Fixed bug #72512 gdImageTrueColorToPaletteBody allows arbitrary write/read access
  Fixed bug #72479 - same as #72434

Conflicts:
	ext/bz2/bz2.c
	main/SAPI.c
	main/php_variables.c
2016-07-19 00:53:08 -07:00
Pierre Joye
8dc5ffa479 fix #72519, possible OOB using imagegif 2016-07-19 00:37:53 -07:00
Pierre Joye
928aecc002 fix #72512, invalid read or write for palette image when invalid transparent index is used
Conflicts:
	ext/gd/libgd/gd.c
2016-07-19 00:37:38 -07:00
Pierre Joye
2707271465 Merge branch 'PHP-7.0'
* PHP-7.0:
  fix #72519, possible OOB using imagegif
2016-07-19 14:16:32 +07:00
Pierre Joye
05e8a0febe Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix #72519, possible OOB using imagegif
2016-07-19 14:16:20 +07:00
Pierre Joye
b61bd1243a Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix #72519, possible OOB using imagegif
2016-07-19 14:16:01 +07:00
Pierre Joye
2fbce5f51f fix #72519, possible OOB using imagegif 2016-07-19 14:11:44 +07:00