about summary refs log tree commit diff
path: root/pkgs/development/libraries/gd/CVE-2016-3074.patch
blob: 76994697729bf8146a568a4384eabe228ed9fa30 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/gd_gd2.c b/src/gd_gd2.c
index 6f28461..a50b33d 100644
--- a/src/gd_gd2.c
+++ b/src/gd_gd2.c
@@ -165,6 +165,8 @@ _gd2GetHeader (gdIOCtxPtr in, int *sx, int *sy,
 			if (gdGetInt (&cidx[i].size, in) != 1) {
 				goto fail2;
 			};
+			if (cidx[i].offset < 0 || cidx[i].size < 0)
+				goto fail2;
 		};
 		*chunkIdx = cidx;
 	};