aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-multimedia/libtiff/files/CVE-2016-5321.patch
blob: 98538ad057b3c478069ccaf8f21a8136f24a85eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From d9783e4a1476b6787a51c5ae9e9b3156527589f0 Mon Sep 17 00:00:00 2001
From: erouault <erouault>
Date: Mon, 11 Jul 2016 21:26:03 +0000
Subject: [PATCH 1/2] * 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)

CVE: CVE-2016-5321
Upstream-Status: Backport
https://github.com/vadz/libtiff/commit/d9783e4a1476b6787a51c5ae9e9b3156527589f0

Signed-off-by: Yi Zhao <yi.zhao@windirver.com>
---
 tools/tiffcrop.c | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

Index: tiff-4.0.4/tools/tiffcrop.c
===================================================================
--- tiff-4.0.4.orig/tools/tiffcrop.c
+++ tiff-4.0.4/tools/tiffcrop.c
@@ -989,7 +989,7 @@ static int  readSeparateTilesIntoBuffer
     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)
Index: tiff-4.0.4/ChangeLog
===================================================================
--- tiff-4.0.4.orig/ChangeLog
+++ tiff-4.0.4/ChangeLog
@@ -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)
+
 2015-12-26  Even Rouault <even.rouault at spatialys.com>
 
    * libtiff/tif_getimage.c: fix out-of-bound reads in TIFFRGBAImage