Commit Graph

161 Commits

Author SHA1 Message Date
Pierre Joye
b25009fc2c #72482, Ilegal write/read access caused by gdImageAALine overflow 2016-07-19 19:34:07 +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
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
511f07b747 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix #72512, invalid read or write for palette image when invalid transparent index is used
2016-07-19 13:39:46 +07:00
Pierre Joye
0fbcff1b35 fix #72512, invalid read or write for palette image when invalid transparent index is used 2016-07-19 13:37:23 +07:00
Stanislav Malyshev
d1a491acf3 Fix for bug #72558, Integer overflow error within _gdContributionsAlloc() 2016-07-18 00:17:48 -07:00
Christoph M. Becker
3666cfab97 Fix #72604: imagearc() ignores thickness for full arcs
We remove the special casing for full arcs, what conforms to external libgd.
2016-07-15 19:45:52 +02:00
Pierre Joye
7b2c22696a Fixed bug #72512 gdImageTrueColorToPaletteBody allows arbitrary write/read access 2016-07-04 10:35:20 +02:00
Stanislav Malyshev
c9b24ef307 Merge branch 'PHP-5.6.23' into PHP-5.6
* PHP-5.6.23:
  Fixed bug #72446 - Integer Overflow in gdImagePaletteToTrueColor() resulting in heap overflow
  update NEWS
  fix tests
  fix build
  Fix bug #72455:  Heap Overflow due to integer overflows
  Fix bug #72434: ZipArchive class Use After Free Vulnerability in PHP's GC algorithm and unserialize
  Fixed ##72433: Use After Free Vulnerability in PHP's GC algorithm and unserialize
  Fix bug #72407: NULL Pointer Dereference at _gdScaleVert
  Fix bug #72402: _php_mb_regex_ereg_replace_exec - double free
  Fix bug #72298	pass2_no_dither out-of-bounds access
  Fixed #72339 Integer Overflow in _gd2GetHeader() resulting in heap overflow
  Fix bug #72262 - do not overflow int
  Fix bug #72400 and #72403 - prevent signed int overflows for string lengths
  Fix bug #72275: don't allow smart_str to overflow int
  Fix bug #72340: Double Free Courruption in wddx_deserialize
  Fix bug #72321 - use efree() for emalloc allocation
  5.6.23RC1

Conflicts:
	configure.in
	main/php_version.h
2016-06-21 00:02:37 -07:00
Stanislav Malyshev
7dde353ee7 Merge branch 'PHP-5.5' into PHP-5.6.23
* PHP-5.5:
  Fixed bug #72446 - Integer Overflow in gdImagePaletteToTrueColor() resulting in heap overflow
  update NEWS
  fix tests
  fix build
  Fix bug #72455:  Heap Overflow due to integer overflows
  Fix bug #72434: ZipArchive class Use After Free Vulnerability in PHP's GC algorithm and unserialize
  Fixed ##72433: Use After Free Vulnerability in PHP's GC algorithm and unserialize
  Fix bug #72407: NULL Pointer Dereference at _gdScaleVert
  Fix bug #72402: _php_mb_regex_ereg_replace_exec - double free
  Fix bug #72298	pass2_no_dither out-of-bounds access
  Fixed #72339 Integer Overflow in _gd2GetHeader() resulting in heap overflow
  Fix bug #72262 - do not overflow int
  Fix bug #72400 and #72403 - prevent signed int overflows for string lengths
  Fix bug #72275: don't allow smart_str to overflow int
  Fix bug #72340: Double Free Courruption in wddx_deserialize
  update NEWS
  Fix #66387: Stack overflow with imagefilltoborder
  Skip test which is 64bits only
  5.5.37 now

Conflicts:
	configure.in
	ext/mcrypt/mcrypt.c
	ext/spl/spl_directory.c
	main/php_version.h
2016-06-21 00:01:48 -07:00
Stanislav Malyshev
c395c6e5d7 iFixed bug #72446 - Integer Overflow in gdImagePaletteToTrueColor() resulting in heap overflow 2016-06-20 23:58:26 -07:00
Christoph M. Becker
4b4275059f Fix #64641: imagefilledpolygon doesn't draw horizontal line
As has been reported, 1-dimensional horizontal filled polygons are not drawn
at all. That is caused by the scanline algorithm used for drawing filled
polygons which skips the drawing of horizontal edges, because that is
normally not necessary. If, however, the polygon consists of horizontal
edges only, that obviously doesn't work, so we add a special case handling.

That has also been fixed in libgd with
<https://github.com/libgd/libgd/commit/f9f10fa9>.
2016-06-20 15:17:52 +02:00
Christoph M. Becker
8aa511f1fc Fix #43475: Styled thick horizontal lines are scrambled
Thick lines are drawn by gdImageFilledRectangle(), which iterates over
the x ordinate first (Z order) to apply the style pattern. While this works
fine for vertical and diagonal lines, it obviously fails for horizontal
lines, which have to be iterated over in N order.

To fix this bug, we introduce the helpers  gdImageFilled(H|V)Rectangle(),
which may be reused for other purposes as well.

This is basically the same fix as libgd/libgd/c2b91dbc.
2016-06-16 13:59:00 +02:00
Christoph M. Becker
f96ebb0986 Fix #66387: Stack overflow with imagefilltoborder
The stack overflow is caused by the recursive algorithm in combination with a
very large negative coordinate passed to gdImageFillToBorder(). As there is
already a clipping for large positive coordinates to the width and height of
the image, it seems to be consequent to clip to zero also.
2016-06-13 08:10:36 +02:00
Pierre Joye
6d3fa654b7 prevent invalid color index (palette only), may lead to crash 2016-06-08 11:06:48 +07:00
Christoph M. Becker
f1228ebc61 Merge branch 'pull-request/1425' into PHP-5.6
* pull-request/1425:
  revised bug53156.phpt
  Fix #53156: imagerectangle problem with point ordering
2015-07-21 01:13:04 +02:00
Christoph M. Becker
e7f2356665 Fix #66387: Stack overflow with imagefilltoborder
The stack overflow is caused by the recursive algorithm in combination with a
very large negative coordinate passed to gdImageFillToBorder(). As there is
already a clipping for large positive coordinates to the width and height of
the image, it seems to be consequent to clip to zero also.
2015-07-20 23:36:32 +02:00
Christoph M. Becker
72b73e24a0 Fix #53156: imagerectangle problem with point ordering
Contrary to imagefilledrectangle(), imagerectangle() has the documented
limitation that the given points have to be the upper left and the lower right
corner, respectively. However, libgd already caters to upper right / lower left
pairs, and not catering to the other two combinations seems to be an oversight.
2015-07-20 02:14:29 +02:00
Christoph M. Becker
094decc3c0 Fix #53154: Zero-height rectangle has whiskers
To avoid drawing the corner pixels twice, gdImageRectangle() draws the vertical
lines 2 points shorter than the actual side of the rectangle. However, this
causes "whiskers" for rectangles with height 0. This patch fixes this issue and
at the same time optimizes the algorithm by drawing only a single line for zero
height and zero width rectangles.
2015-07-13 01:33:00 +02:00
Stanislav Malyshev
184b6d9e73 fix memory leak 2015-01-04 21:07:57 -08:00
Christopher Jones
cd14de94d2 Reduce compiler noise by removing unused variables and labels 2013-08-14 21:06:59 -07:00
Pierre Joye
07e52857b5 fix #65070, bgcolor does not use the same format as the input image with imagerotate 2013-06-20 22:19:33 +02:00
Pierre Joye
7bd20354a8 - #64710, kill unused var 2013-04-26 08:15:05 +02:00
Pierre Joye
685a6d9aab #64710, kill unused vars 2013-04-26 08:09:19 +02:00
Pierre Joye
b5902b6c9d #64710, kill unused vars 2013-04-26 08:06:34 +02:00
Pierre Joye
22159fb7b7 - add new interpolation method
. imagescale
  . imageaffine
  . replace imagerotate with new generic and optimized new implementations
  . imagesetinterpolationmethod, to set the default interpolation to be
    used with the new functions
  . add imagepalettetotruecolor
2013-03-20 07:46:59 +01:00
Florian Anderiasch
be930868aa Fixed #60160 and added a test for it 2011-11-01 11:51:53 +00:00
Pierre Joye
ef76df031b - - Fixed #51128, imagefill() doesn't work with large images 2010-04-28 14:35:42 +00:00
Pierre Joye
c09a8cb043 - Fix #51671, imagefill does not work correctly for small images 2010-04-28 08:23:44 +00:00
Pierre Joye
27d922c49f - WS 2010-04-28 08:04:52 +00:00
Takeshi Abe
bea0320749 fix libgd FS100 (spurious horizontal line drawn by gdImageFilledPolygon) 2010-01-20 09:39:06 +00:00
Takeshi Abe
f7a3b3f5aa imagepolygon() and imagefilledpolygon() does not allow negative number of points causing invalid allocation 2010-01-14 11:11:56 +00:00
Pierre Joye
8f8220917e - Fix sanity check for the color index in imagecolortransparent 2009-09-03 09:45:56 +00:00
Kalle Sommer Nielsen
b5b8303194 Fixed bug #42434 (ImageLine w/ antialias = 1px shorter)
- patch by wojjie at gmail dot com
2009-07-28 20:35:06 +00:00
Pierre Joye
c79f7e3f6b - WS 2009-07-07 10:54:44 +00:00
Pierre Joye
b38fde4694 - #45905, imagefilledrectangle() clipping error 2009-07-07 10:49:38 +00:00
Pierre Joye
59ec80c572 - MFH: [DOC] always enable imagerotate (bundled or system gd) 2009-05-27 07:18:05 +00:00
Pierre Joye
a008f130cd - MFH: [DOC] - add image(filled)ellipse to the compat layer (work around a bug in debian too, function is declared but not present in the lib...) 2009-05-26 20:14:31 +00:00
Pierre Joye
b682f42915 - [DOC] always enable imagefilter and imageconvolution, even when built against system's gd 2009-05-26 12:50:40 +00:00
Kalle Sommer Nielsen
437e9e6c7c This shouldn't have been in for now 2009-04-25 06:25:55 +00:00
Kalle Sommer Nielsen
9a718dd97c MFH: Use correct data types here, and gdImageSaveAlpha for the alpha flag 2009-04-25 06:22:14 +00:00
Takeshi Abe
47b6dc50a4 MFHcheck non-null before any use. 2009-04-23 16:26:17 +00:00
Ilia Alshanetsky
c593790b62 Fixed bug #47946 (ImageConvolution overwrites background)
# original patch by  jcolby at acsol dot net
2009-04-12 14:43:21 +00:00
Takeshi Abe
3e3721be58 MFH: Fixed libgd #186 (Tiling true colour with palette image does not work) 2009-03-18 15:30:37 +00:00
Takeshi Abe
b48f46b092 MFH: optimization via the row-major order. 2009-02-11 16:31:27 +00:00
Takeshi Abe
c422d15d0e MFH: fixed the bug of libgd #191 (A circle becomes square) 2009-01-19 15:43:48 +00:00
Scott MacVicar
fdb9b62cef MFH Fix segfault and potential security issue in imagerotate(). 2008-12-10 13:32:02 +00:00
Rasmus Lerdorf
a3383ac3d7 Fix for bug #45030 2008-07-31 09:23:18 +00:00
Mattias Bengtsson
81a874710e -MFB, Fixed Bug #43121 (gdImageFill with IMG_COLOR_TILED crashes httpd) 2007-11-04 23:56:41 +00:00
Pierre Joye
fd15282c77 - [DOC] add alpha support for imagefilter's IMG_FILTER_COLORIZE 2007-09-11 21:03:48 +00:00