Skip to content
This repository has been archived by the owner on Dec 1, 2017. It is now read-only.

Commit

Permalink
* tools/tiffcrop.c: Avoid access outside of stack allocated array
Browse files Browse the repository at this point in the history
on a tiled separate TIFF with more than 8 samples per pixel.
Reported by Kaixiang Zhang of the Cloud Security Team, Qihoo 360
(CVE-2016-5321, bugzilla #2558)
  • Loading branch information
erouault committed Jul 11, 2016
1 parent 0ba5d88 commit d9783e4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2016-07-11 Even Rouault <even.rouault at spatialys.com>

* tools/tiffcrop.c: Avoid access outside of stack allocated array
on a tiled separate TIFF with more than 8 samples per pixel.
Reported by Kaixiang Zhang of the Cloud Security Team, Qihoo 360
(CVE-2016-5321, bugzilla #2558)

2016-07-10 Even Rouault <even.rouault at spatialys.com>

* libtiff/tif_read.c: Fix out-of-bounds read on
Expand Down
2 changes: 1 addition & 1 deletion tools/tiffcrop.c
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,7 @@ static int readSeparateTilesIntoBuffer (TIFF* in, uint8 *obuf,
nrow = (row + tl > imagelength) ? imagelength - row : tl;
for (col = 0; col < imagewidth; col += tw)
{
for (s = 0; s < spp; s++)
for (s = 0; s < spp && s < MAX_SAMPLES; s++)
{ /* Read each plane of a tile set into srcbuffs[s] */
tbytes = TIFFReadTile(in, srcbuffs[s], col, row, 0, s);
if (tbytes < 0 && !ignore)
Expand Down

0 comments on commit d9783e4

Please sign in to comment.