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

Commit 5397a41

Browse files
author
erouault
committed
* tools/tiffcp.c: avoid uint32 underflow in cpDecodedStrips that
can cause various issues, such as buffer overflows in the library. Reported by Agostino Sarubbo. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2598
1 parent 438274f commit 5397a41

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Diff for: ChangeLog

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2016-12-02 Even Rouault <even.rouault at spatialys.com>
2+
3+
* tools/tiffcp.c: avoid uint32 underflow in cpDecodedStrips that
4+
can cause various issues, such as buffer overflows in the library.
5+
Reported by Agostino Sarubbo.
6+
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2598
7+
18
2016-12-02 Even Rouault <even.rouault at spatialys.com>
29

310
* libtiff/tif_read.c, libtiff/tiffiop.h: fix uint32 overflow in

Diff for: tools/tiffcp.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,7 @@ DECLAREcpFunc(cpDecodedStrips)
985985
tstrip_t s, ns = TIFFNumberOfStrips(in);
986986
uint32 row = 0;
987987
_TIFFmemset(buf, 0, stripsize);
988-
for (s = 0; s < ns; s++) {
988+
for (s = 0; s < ns && row < imagelength; s++) {
989989
tsize_t cc = (row + rowsperstrip > imagelength) ?
990990
TIFFVStripSize(in, imagelength - row) : stripsize;
991991
if (TIFFReadEncodedStrip(in, s, buf, cc) < 0

0 commit comments

Comments
 (0)