* 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
This commit is contained in:
parent
30703a1677
commit
78dab0996f
@ -1,3 +1,10 @@
|
||||
2016-12-02 Even Rouault <even.rouault at spatialys.com>
|
||||
|
||||
* 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
|
||||
|
||||
2016-12-02 Even Rouault <even.rouault at spatialys.com>
|
||||
|
||||
* libtiff/tif_read.c, libtiff/tiffiop.h: fix uint32 overflow in
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id: tiffcp.c,v 1.55 2016-10-08 15:54:57 erouault Exp $ */
|
||||
/* $Id: tiffcp.c,v 1.56 2016-12-02 22:13:32 erouault Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988-1997 Sam Leffler
|
||||
@ -985,7 +985,7 @@ DECLAREcpFunc(cpDecodedStrips)
|
||||
tstrip_t s, ns = TIFFNumberOfStrips(in);
|
||||
uint32 row = 0;
|
||||
_TIFFmemset(buf, 0, stripsize);
|
||||
for (s = 0; s < ns; s++) {
|
||||
for (s = 0; s < ns && row < imagelength; s++) {
|
||||
tsize_t cc = (row + rowsperstrip > imagelength) ?
|
||||
TIFFVStripSize(in, imagelength - row) : stripsize;
|
||||
if (TIFFReadEncodedStrip(in, s, buf, cc) < 0
|
||||
|
Loading…
Reference in New Issue
Block a user