Gentoo Archives: gentoo-commits

From: "Timo Gurr (tgurr)" <tgurr@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-print/cups/files: cups-1.3.8-CVE-2008-3641.patch cups-1.3.8-CVE-2008-3640.patch cups-1.3.8-str2924.patch cups-1.3.8-CVE-2008-3639.patch
Date: Fri, 10 Oct 2008 19:38:53
Message-Id: E1KoNp4-0008D0-MM@stork.gentoo.org
1 tgurr 08/10/10 19:38:50
2
3 Added: cups-1.3.8-CVE-2008-3641.patch
4 cups-1.3.8-CVE-2008-3640.patch
5 cups-1.3.8-str2924.patch
6 cups-1.3.8-CVE-2008-3639.patch
7 Log:
8 Bump CUPS to new version 1.3.9 and revision 1.3.8-r2 to address some security issues, bug #238976 and fix the broken desktop file, bug #236706 (Thanks to Pacho Ramos). Remove keywords on 1.2.12 to prevent users from installing a unsecure CUPS version.
9 (Portage version: 2.2_rc12/cvs/Linux 2.6.26-gentoo-r1 x86_64, RepoMan options: --force)
10
11 Revision Changes Path
12 1.1 net-print/cups/files/cups-1.3.8-CVE-2008-3641.patch
13
14 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-print/cups/files/cups-1.3.8-CVE-2008-3641.patch?rev=1.1&view=markup
15 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-print/cups/files/cups-1.3.8-CVE-2008-3641.patch?rev=1.1&content-type=text/plain
16
17 Index: cups-1.3.8-CVE-2008-3641.patch
18 ===================================================================
19 Index: cups-1.3.8/filter/hpgl-attr.c
20 ===================================================================
21 --- cups-1.3.8.orig/filter/hpgl-attr.c
22 +++ cups-1.3.8/filter/hpgl-attr.c
23 @@ -197,8 +197,18 @@ NP_number_pens(int num_params, /* I
24
25 if (num_params == 0)
26 PenCount = 8;
27 - else if (num_params == 1 && params[0].value.number <= 1024)
28 - PenCount = (int)params[0].value.number;
29 + else if (num_params == 1)
30 + {
31 + if (params[0].value.number < 1 || params[0].value.number > MAX_PENS)
32 + {
33 + fprintf(stderr,
34 + "DEBUG: HP-GL/2 \'NP\' command with invalid number of "
35 + "pens (%d)!\n", (int)params[0].value.number);
36 + PenCount = 8;
37 + }
38 + else
39 + PenCount = (int)params[0].value.number;
40 + }
41 else
42 fprintf(stderr,
43 "DEBUG: HP-GL/2 \'NP\' command with invalid number of "
44 @@ -235,7 +245,7 @@ PC_pen_color(int num_params, /* I -
45
46 if (num_params == 0)
47 {
48 - for (i = 0; i <= PenCount; i ++)
49 + for (i = 0; i < PenCount; i ++)
50 if (i < 8)
51 {
52 Pens[i].rgb[0] = standard_colors[i][0];
53 @@ -256,7 +266,14 @@ PC_pen_color(int num_params, /* I -
54 }
55 else if (num_params == 1 || num_params == 4)
56 {
57 - i = (int)params[0].value.number;
58 + i = (int)params[0].value.number - 1;
59 +
60 + if (i < 0 || i >= PenCount)
61 + {
62 + fprintf(stderr,
63 + "DEBUG: HP-GL/2 \'PC\' command with invalid pen (%d)!\n", i + 1);
64 + return;
65 + }
66
67 if (num_params == 1)
68 {
69 @@ -330,7 +347,15 @@ PW_pen_width(int num_params, /* I -
70
71 if (num_params == 2)
72 {
73 - pen = (int)params[1].value.number;
74 + pen = (int)params[1].value.number - 1;
75 +
76 + if (pen < 0 || pen >= PenCount)
77 + {
78 + fprintf(stderr,
79 + "DEBUG: HP-GL/2 \'PW\' command with invalid pen (%d)!\n",
80 + pen + 1);
81 + return;
82 + }
83
84 Pens[pen].width = w;
85
86 @@ -345,7 +370,7 @@ PW_pen_width(int num_params, /* I -
87 * Set width for all pens...
88 */
89
90 - for (pen = 0; pen <= PenCount; pen ++)
91 + for (pen = 0; pen < PenCount; pen ++)
92 Pens[pen].width = w;
93
94 if (PageDirty)
95 @@ -399,14 +424,16 @@ SP_select_pen(int num_params, /* I -
96 param_t *params) /* I - Parameters */
97 {
98 if (num_params == 0)
99 - PenNumber = 1;
100 - else if (params[0].value.number <= PenCount)
101 - PenNumber = (int)params[0].value.number;
102 - else
103 + PenNumber = 0;
104 + else if (num_params > 1)
105 fprintf(stderr,
106 - "DEBUG: HP-GL/2 \'SP\' command with invalid number or value "
107 - "of parameters (%d, %d)!\n", num_params,
108 + "DEBUG: HP-GL/2 \'SP\' command with invalid number of parameters "
109 + "(%d)!\n", num_params);
110 + else if (params[0].value.number <= 0 || params[0].value.number >= PenCount)
111 + fprintf(stderr, "DEBUG: HP-GL/2 \'SP\' command with invalid pen (%d)!\n",
112 (int)params[0].value.number);
113 + else
114 + PenNumber = (int)params[0].value.number - 1;
115
116 if (PageDirty)
117 printf("%.3f %.3f %.3f %.2f SP\n", Pens[PenNumber].rgb[0],
118 Index: cups-1.3.8/filter/hpgltops.h
119 ===================================================================
120 --- cups-1.3.8.orig/filter/hpgltops.h
121 +++ cups-1.3.8/filter/hpgltops.h
122 @@ -26,6 +26,14 @@
123 # define M_PI 3.14159265358979323846
124 #endif /* M_PI */
125
126 +
127 +/*
128 + * Maximum number of pens we emulate...
129 + */
130 +
131 +#define MAX_PENS 1024
132 +
133 +
134 /*
135 * Parameter value structure...
136 */
137 @@ -108,10 +116,10 @@ VAR float PenPosition[2] VALUE2(0.0f, 0.
138 /* Current pen position */
139 PenScaling VALUE(1.0f), /* Pen width scaling factor */
140 PenWidth VALUE(1.0f); /* Default pen width */
141 -VAR pen_t Pens[1024]; /* State of each pen */
142 +VAR pen_t Pens[MAX_PENS]; /* State of each pen */
143 VAR int PenMotion VALUE(0), /* 0 = absolute, 1 = relative */
144 PenValid VALUE(0), /* 1 = valid position, 0 = undefined */
145 - PenNumber VALUE(1), /* Current pen number */
146 + PenNumber VALUE(0), /* Current pen number */
147 PenCount VALUE(8), /* Number of pens */
148 PenDown VALUE(0), /* 0 = pen up, 1 = pen down */
149 PolygonMode VALUE(0), /* Drawing polygons? */
150
151
152
153 1.1 net-print/cups/files/cups-1.3.8-CVE-2008-3640.patch
154
155 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-print/cups/files/cups-1.3.8-CVE-2008-3640.patch?rev=1.1&view=markup
156 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-print/cups/files/cups-1.3.8-CVE-2008-3640.patch?rev=1.1&content-type=text/plain
157
158 Index: cups-1.3.8-CVE-2008-3640.patch
159 ===================================================================
160 Index: cups-1.3.8/filter/texttops.c
161 ===================================================================
162 --- cups-1.3.8.orig/filter/texttops.c
163 +++ cups-1.3.8/filter/texttops.c
164 @@ -173,6 +173,14 @@ WriteProlog(const char *title, /* I - T
165 SizeColumns = (PageRight - PageLeft) / 72.0 * CharsPerInch;
166 SizeLines = (PageTop - PageBottom) / 72.0 * LinesPerInch;
167
168 + if (SizeColumns <= 0 || SizeColumns > 32767 ||
169 + SizeLines <= 0 || SizeLines > 32767)
170 + {
171 + _cupsLangPrintf(stderr, _("ERROR: Unable to print %dx%d text page!\n"),
172 + SizeColumns, SizeLines);
173 + exit(1);
174 + }
175 +
176 Page = calloc(sizeof(lchar_t *), SizeLines);
177 Page[0] = calloc(sizeof(lchar_t), SizeColumns * SizeLines);
178 for (i = 1; i < SizeLines; i ++)
179 @@ -187,6 +195,13 @@ WriteProlog(const char *title, /* I - T
180 else
181 ColumnWidth = SizeColumns;
182
183 + if (ColumnWidth <= 0)
184 + {
185 + _cupsLangPrintf(stderr, _("ERROR: Unable to print %d text columns!\n"),
186 + PageColumns);
187 + exit(1);
188 + }
189 +
190 /*
191 * Output the DSC header...
192 */
193 Index: cups-1.3.8/filter/textcommon.c
194 ===================================================================
195 --- cups-1.3.8.orig/filter/textcommon.c
196 +++ cups-1.3.8/filter/textcommon.c
197 @@ -3,7 +3,7 @@
198 *
199 * Common text filter routines for the Common UNIX Printing System (CUPS).
200 *
201 - * Copyright 2007 by Apple Inc.
202 + * Copyright 2007-2008 by Apple Inc.
203 * Copyright 1997-2007 by Easy Software Products.
204 *
205 * These coded instructions, statements, and computer programs are the
206 @@ -605,14 +605,38 @@ TextMain(const char *name, /* I - Name o
207 !strcasecmp(val, "yes");
208
209 if ((val = cupsGetOption("columns", num_options, options)) != NULL)
210 + {
211 PageColumns = atoi(val);
212
213 + if (PageColumns < 1)
214 + {
215 + _cupsLangPrintf(stderr, _("ERROR: Bad columns value %d!\n"), PageColumns);
216 + return (1);
217 + }
218 + }
219 +
220 if ((val = cupsGetOption("cpi", num_options, options)) != NULL)
221 + {
222 CharsPerInch = atof(val);
223
224 + if (CharsPerInch <= 0.0)
225 + {
226 + _cupsLangPrintf(stderr, _("ERROR: Bad cpi value %f!\n"), CharsPerInch);
227 + return (1);
228 + }
229 + }
230 +
231 if ((val = cupsGetOption("lpi", num_options, options)) != NULL)
232 + {
233 LinesPerInch = atof(val);
234
235 + if (LinesPerInch <= 0.0)
236 + {
237 + _cupsLangPrintf(stderr, _("ERROR: Bad lpi value %f!\n"), LinesPerInch);
238 + return (1);
239 + }
240 + }
241 +
242 if (PrettyPrint)
243 PageTop -= 216.0f / LinesPerInch;
244
245
246
247
248 1.1 net-print/cups/files/cups-1.3.8-str2924.patch
249
250 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-print/cups/files/cups-1.3.8-str2924.patch?rev=1.1&view=markup
251 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-print/cups/files/cups-1.3.8-str2924.patch?rev=1.1&content-type=text/plain
252
253 Index: cups-1.3.8-str2924.patch
254 ===================================================================
255 Index: desktop/cups.desktop
256 ===================================================================
257 --- desktop/cups.desktop (revision 7908)
258 +++ desktop/cups.desktop (working copy)
259 @@ -1,41 +1,33 @@
260 [Desktop Entry]
261 -Categories=Application;System;X-Red-Hat-Base;
262 -Encoding=UTF-8
263 +Categories=System;Printing;HardwareSettings;X-Red-Hat-Base;
264 Exec=htmlview http://localhost:631/
265 -GenericName=
266 Icon=cups
267 -MimeType=
268 -Path=
269 StartupNotify=false
270 Terminal=false
271 -TerminalOptions=
272 Type=Application
273 -X-DCOP-ServiceType=
274 -X-KDE-SubstituteUID=false
275 -X-KDE-Username=
276 Name=Manage Printing
277 Comment=CUPS Web Interface
278 -Name[de]=Druckerverwaltung
279 -Comment[de]=CUPS Webinterface
280 -Name[en_US]=Manage Printing
281 -Comment[en_US]=CUPS Web Interface
282 -Name[es]=Administrar impresión
283 -Comment[es]=Interfaz Web de CUPS
284 -Name[et]=Trükkimise haldur
285 -Comment[et]=CUPS-i veebiliides
286 -Name[fr]=Gestionnaire d'impression
287 -Comment[fr]=Interface Web de CUPS
288 -Name[he]=נהל הדפסות
289 -Comment[he]=ממשק דפדפן של CUPS
290 -Name[id]=Manajemen Pencetakan
291 -Comment[id]=Antarmuka Web CUPS
292 -Name[it]=Gestione stampa
293 -Comment[it]=Interfaccia web di CUPS
294 -Name[ja]=印刷の管理
295 -Comment[ja]=CUPS Web インタフェース
296 -Name[pl]=Zarządzanie drukowaniem
297 -Comment[pl]=Interfejs WWW CUPS
298 -Name[zh]=打印机管理
299 -Comment[zh]=CUPS网页界面
300 -Name[zh_TW]=印表管理
301 -Comment[zh_TW]=CUPS 網頁介面
302 +Name[de.UTF-8]=Druckerverwaltung
303 +Comment[de.UTF-8]=CUPS Webinterface
304 +Name[en_US.UTF-8]=Manage Printing
305 +Comment[en_US.UTF-8]=CUPS Web Interface
306 +Name[es.UTF-8]=Administrar impresión
307 +Comment[es.UTF-8]=Interfaz Web de CUPS
308 +Name[et.UTF-8]=Trükkimise haldur
309 +Comment[et.UTF-8]=CUPS-i veebiliides
310 +Name[fr.UTF-8]=Gestionnaire d'impression
311 +Comment[fr.UTF-8]=Interface Web de CUPS
312 +Name[he.UTF-8]=נהל הדפסות
313 +Comment[he.UTF-8]=ממשק דפדפן של CUPS
314 +Name[id.UTF-8]=Manajemen Pencetakan
315 +Comment[id.UTF-8]=Antarmuka Web CUPS
316 +Name[it.UTF-8]=Gestione stampa
317 +Comment[it.UTF-8]=Interfaccia web di CUPS
318 +Name[ja.UTF-8]=印刷の管理
319 +Comment[ja.UTF-8]=CUPS Web インタフェース
320 +Name[pl.UTF-8]=Zarządzanie drukowaniem
321 +Comment[pl.UTF-8]=Interfejs WWW CUPS
322 +Name[zh.UTF-8]=打印机管理
323 +Comment[zh.UTF-8]=CUPS网页界面
324 +Name[zh_TW.UTF-8]=印表管理
325 +Comment[zh_TW.UTF-8]=CUPS 網頁介面
326
327
328
329 1.1 net-print/cups/files/cups-1.3.8-CVE-2008-3639.patch
330
331 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-print/cups/files/cups-1.3.8-CVE-2008-3639.patch?rev=1.1&view=markup
332 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-print/cups/files/cups-1.3.8-CVE-2008-3639.patch?rev=1.1&content-type=text/plain
333
334 Index: cups-1.3.8-CVE-2008-3639.patch
335 ===================================================================
336 Index: cups-1.3.8/filter/image-sgilib.c
337 ===================================================================
338 --- cups-1.3.8.orig/filter/image-sgilib.c
339 +++ cups-1.3.8/filter/image-sgilib.c
340 @@ -640,13 +640,14 @@ read_rle8(FILE *fp, /* I - Fi
341 if (ch & 128)
342 {
343 for (i = 0; i < count; i ++, row ++, xsize --, length ++)
344 - *row = getc(fp);
345 + if (xsize > 0)
346 + *row = getc(fp);
347 }
348 else
349 {
350 ch = getc(fp);
351 length ++;
352 - for (i = 0; i < count; i ++, row ++, xsize --)
353 + for (i = 0; i < count && xsize > 0; i ++, row ++, xsize --)
354 *row = ch;
355 }
356 }
357 @@ -685,14 +686,15 @@ read_rle16(FILE *fp, /* I - F
358 if (ch & 128)
359 {
360 for (i = 0; i < count; i ++, row ++, xsize --, length ++)
361 - *row = getshort(fp);
362 + if (xsize > 0)
363 + *row = getshort(fp);
364 }
365 else
366 {
367 ch = getshort(fp);
368 length ++;
369 - for (i = 0; i < count; i ++, row ++, xsize --)
370 - *row = ch;
371 + for (i = 0; i < count && xsize > 0; i ++, row ++, xsize --)
372 + *row = ch;
373 }
374 }