summaryrefslogtreecommitdiffstats
path: root/filters/kword/pdf/diffs/xpdf_security_integer_overflow_2.diff
blob: e64646128111baa45bb2b076e965b4d39e0799e1 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
Index: goo/GHash.cc
===================================================================
RCS file: /home/kde/koffice/filters/kword/pdf/xpdf/goo/GHash.cc,v
retrieving revision 1.3
retrieving revision 1.2.2.1
diff -u -p -r1.3 -r1.2.2.1
--- goo/GHash.cc	10 Oct 2004 21:37:09 -0000	1.3
+++ goo/GHash.cc	21 Oct 2004 20:32:51 -0000	1.2.2.1
@@ -8,7 +8,6 @@
 
 #include <aconf.h>
 
-
 #include "gmem.h"
 #include "GString.h"
 #include "GHash.h"
Index: goo/GHash.h
===================================================================
RCS file: /home/kde/koffice/filters/kword/pdf/xpdf/goo/GHash.h,v
retrieving revision 1.3
retrieving revision 1.2.2.1
diff -u -p -r1.3 -r1.2.2.1
--- goo/GHash.h	10 Oct 2004 21:37:09 -0000	1.3
+++ goo/GHash.h	21 Oct 2004 20:32:51 -0000	1.2.2.1
@@ -11,7 +11,6 @@
 
 #include <aconf.h>
 
-
 #include "gtypes.h"
 
 class GString;
Index: goo/GList.cc
===================================================================
RCS file: /home/kde/koffice/filters/kword/pdf/xpdf/goo/GList.cc,v
retrieving revision 1.2
retrieving revision 1.1.2.1
diff -u -p -r1.2 -r1.1.2.1
--- goo/GList.cc	10 Oct 2004 21:37:09 -0000	1.2
+++ goo/GList.cc	21 Oct 2004 20:32:51 -0000	1.1.2.1
@@ -8,7 +8,6 @@
 
 #include <aconf.h>
 
-
 #include <string.h>
 #include "gmem.h"
 #include "GList.h"
Index: goo/GList.h
===================================================================
RCS file: /home/kde/koffice/filters/kword/pdf/xpdf/goo/GList.h,v
retrieving revision 1.2
retrieving revision 1.1.2.1
diff -u -p -r1.2 -r1.1.2.1
--- goo/GList.h	10 Oct 2004 21:37:09 -0000	1.2
+++ goo/GList.h	21 Oct 2004 20:32:51 -0000	1.1.2.1
@@ -11,7 +11,6 @@
 
 #include <aconf.h>
 
-
 #include "gtypes.h"
 
 //------------------------------------------------------------------------
Index: goo/GString.cc
===================================================================
RCS file: /home/kde/koffice/filters/kword/pdf/xpdf/goo/GString.cc,v
retrieving revision 1.2
retrieving revision 1.1.2.1
diff -u -p -r1.2 -r1.1.2.1
--- goo/GString.cc	10 Oct 2004 21:37:09 -0000	1.2
+++ goo/GString.cc	21 Oct 2004 20:32:51 -0000	1.1.2.1
@@ -10,7 +10,6 @@
 
 #include <aconf.h>
 
-
 #include <stdlib.h>
 #include <stddef.h>
 #include <string.h>
Index: goo/GString.h
===================================================================
RCS file: /home/kde/koffice/filters/kword/pdf/xpdf/goo/GString.h,v
retrieving revision 1.3
retrieving revision 1.2.2.1
diff -u -p -r1.3 -r1.2.2.1
--- goo/GString.h	10 Oct 2004 21:37:09 -0000	1.3
+++ goo/GString.h	21 Oct 2004 20:32:51 -0000	1.2.2.1
@@ -13,7 +13,6 @@
 
 #include <aconf.h>
 
-
 #include <string.h>
 
 class GString {
Index: xpdf/Gfx.cc
===================================================================
RCS file: /home/kde/koffice/filters/kword/pdf/xpdf/xpdf/Gfx.cc,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -p -r1.3 -r1.3.2.1
--- xpdf/Gfx.cc	25 Jan 2003 23:17:44 -0000	1.3
+++ xpdf/Gfx.cc	22 Dec 2004 12:07:12 -0000	1.3.2.1
@@ -2379,7 +2379,9 @@ void Gfx::doImage(Object *ref, Stream *s
     haveMask = gFalse;
     dict->lookup("Mask", &maskObj);
     if (maskObj.isArray()) {
-      for (i = 0; i < maskObj.arrayGetLength(); ++i) {
+      for (i = 0;
+	   i < maskObj.arrayGetLength() && i < 2*gfxColorMaxComps;
+	   ++i) {
 	maskObj.arrayGet(i, &obj1);
 	maskColors[i] = obj1.getInt();
 	obj1.free();
Index: xpdf/GfxState.cc
===================================================================
RCS file: /home/kde/koffice/filters/kword/pdf/xpdf/xpdf/GfxState.cc,v
retrieving revision 1.3
retrieving revision 1.3.2.2
diff -u -p -r1.3 -r1.3.2.2
--- xpdf/GfxState.cc	25 Jan 2003 23:17:44 -0000	1.3
+++ xpdf/GfxState.cc	22 Dec 2004 13:50:53 -0000	1.3.2.2
@@ -682,6 +682,11 @@ GfxColorSpace *GfxICCBasedColorSpace::pa
   }
   nCompsA = obj2.getInt();
   obj2.free();
+  if (nCompsA > gfxColorMaxComps) {
+    error(-1, "ICCBased color space with too many (%d > %d) components",
+	  nCompsA, gfxColorMaxComps);
+    nCompsA = gfxColorMaxComps;
+  }
   if (dict->lookup("Alternate", &obj2)->isNull() ||
       !(altA = GfxColorSpace::parse(&obj2))) {
     switch (nCompsA) {
@@ -1023,6 +1028,11 @@ GfxColorSpace *GfxDeviceNColorSpace::par
     goto err2;
   }
   nCompsA = obj1.arrayGetLength();
+  if (nCompsA > gfxColorMaxComps) {
+    error(-1, "DeviceN color space with too many (%d > %d) components",
+        nCompsA, gfxColorMaxComps);
+    nCompsA = gfxColorMaxComps;
+  }
   for (i = 0; i < nCompsA; ++i) {
     if (!obj1.arrayGet(i, &obj2)->isName()) {
       error(-1, "Bad DeviceN color space (names)");