build,travis: really fail Travis job when build test fail
[feed/packages.git] / libs / tiff / patches / 112-CVE.patch
1 commit b34209fede77aa203cd5adcd9638ccc70731a50f
2 Author: erouault <erouault>
3 Date: Sat Dec 3 16:40:01 2016 +0000
4
5 * tools/tiffcp.c: fix uint32 underflow/overflow that can cause heap-based
6 buffer overflow.
7 Reported by Agostino Sarubbo.
8 Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2610
9
10 diff --git a/ChangeLog b/ChangeLog
11 index 94be038..8ee76c0 100644
12 --- a/ChangeLog
13 +++ b/ChangeLog
14 @@ -1,5 +1,12 @@
15 2016-12-03 Even Rouault <even.rouault at spatialys.com>
16
17 + * tools/tiffcp.c: fix uint32 underflow/overflow that can cause heap-based
18 + buffer overflow.
19 + Reported by Agostino Sarubbo.
20 + Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2610
21 +
22 +2016-12-03 Even Rouault <even.rouault at spatialys.com>
23 +
24 * tools/tiffcp.c: avoid potential division by zero if BitsPerSamples tag is
25 missing.
26 Reported by Agostino Sarubbo.
27 diff --git a/tools/tiffcp.c b/tools/tiffcp.c
28 index 142cbb0..6d96bb8 100644
29 --- a/tools/tiffcp.c
30 +++ b/tools/tiffcp.c
31 @@ -1,4 +1,4 @@
32 -/* $Id: tiffcp.c,v 1.58 2016-12-03 15:44:15 erouault Exp $ */
33 +/* $Id: tiffcp.c,v 1.59 2016-12-03 16:40:01 erouault Exp $ */
34
35 /*
36 * Copyright (c) 1988-1997 Sam Leffler
37 @@ -1163,7 +1163,7 @@ bad:
38
39 static void
40 cpStripToTile(uint8* out, uint8* in,
41 - uint32 rows, uint32 cols, int outskew, int inskew)
42 + uint32 rows, uint32 cols, int outskew, int64 inskew)
43 {
44 while (rows-- > 0) {
45 uint32 j = cols;
46 @@ -1320,7 +1320,7 @@ DECLAREreadFunc(readContigTilesIntoBuffer)
47 tdata_t tilebuf;
48 uint32 imagew = TIFFScanlineSize(in);
49 uint32 tilew = TIFFTileRowSize(in);
50 - int iskew = imagew - tilew;
51 + int64 iskew = (int64)imagew - (int64)tilew;
52 uint8* bufp = (uint8*) buf;
53 uint32 tw, tl;
54 uint32 row;
55 @@ -1348,7 +1348,7 @@ DECLAREreadFunc(readContigTilesIntoBuffer)
56 status = 0;
57 goto done;
58 }
59 - if (colb + tilew > imagew) {
60 + if (colb > iskew) {
61 uint32 width = imagew - colb;
62 uint32 oskew = tilew - width;
63 cpStripToTile(bufp + colb,