View | Details | Raw Unified | Return to bug 127434
Collapse All | Expand All

(-)tiff/Makefile (-1 / +4 lines)
Lines 9-15 Link Here
9
9
10
PORTNAME=	tiff
10
PORTNAME=	tiff
11
PORTVERSION=	3.8.2
11
PORTVERSION=	3.8.2
12
PORTREVISION=	1
12
PORTREVISION=	2
13
CATEGORIES=	graphics
13
CATEGORIES=	graphics
14
MASTER_SITES=	ftp://ftp.remotesensing.org/pub/libtiff/ \
14
MASTER_SITES=	ftp://ftp.remotesensing.org/pub/libtiff/ \
15
		http://dl1.maptools.org/dl/libtiff/
15
		http://dl1.maptools.org/dl/libtiff/
Lines 126-129 Link Here
126
	${INSTALL_DATA} ${WRKSRC}/html/man/*.html ${DOCSDIR}/man/
126
	${INSTALL_DATA} ${WRKSRC}/html/man/*.html ${DOCSDIR}/man/
127
.endif
127
.endif
128
128
129
regression-test: build
130
	@(cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_ARGS} check)
131
129
.include <bsd.port.mk>
132
.include <bsd.port.mk>
(-)tiff/files/patch-libtiff+tif_dir.c (+95 lines)
Line 0 Link Here
1
CVE-2006-3464,3465
2
===================================================================
3
--- libtiff/tif_dir.c.orig	2008-08-17 13:03:48.954994295 -0400
4
+++ libtiff/tif_dir.c	2008-08-17 13:03:52.881994558 -0400
5
@@ -122,6 +122,7 @@
6
 {
7
 	static const char module[] = "_TIFFVSetField";
8
 	
9
+	const TIFFFieldInfo* fip = _TIFFFindFieldInfo(tif, tag, TIFF_ANY);
10
 	TIFFDirectory* td = &tif->tif_dir;
11
 	int status = 1;
12
 	uint32 v32, i, v;
13
@@ -195,10 +196,12 @@
14
 		break;
15
 	case TIFFTAG_ORIENTATION:
16
 		v = va_arg(ap, uint32);
17
+		const TIFFFieldInfo* fip;
18
 		if (v < ORIENTATION_TOPLEFT || ORIENTATION_LEFTBOT < v) {
19
+			fip = _TIFFFieldWithTag(tif, tag);
20
 			TIFFWarningExt(tif->tif_clientdata, tif->tif_name,
21
 			    "Bad value %lu for \"%s\" tag ignored",
22
-			    v, _TIFFFieldWithTag(tif, tag)->field_name);
23
+			    v, fip ? fip->field_name : "Unknown");
24
 		} else
25
 			td->td_orientation = (uint16) v;
26
 		break;
27
@@ -387,11 +390,15 @@
28
 	     * happens, for example, when tiffcp is used to convert between
29
 	     * compression schemes and codec-specific tags are blindly copied.
30
              */
31
+	    /* 
32
+	     * better not dereference fip if it is NULL.
33
+	     * -- taviso@google.com 15 Jun 2006
34
+	     */
35
             if(fip == NULL || fip->field_bit != FIELD_CUSTOM) {
36
 		TIFFErrorExt(tif->tif_clientdata, module,
37
 		    "%s: Invalid %stag \"%s\" (not supported by codec)",
38
 		    tif->tif_name, isPseudoTag(tag) ? "pseudo-" : "",
39
-		    _TIFFFieldWithTag(tif, tag)->field_name);
40
+		    fip ? fip->field_name : "Unknown");
41
 		status = 0;
42
 		break;
43
             }
44
@@ -468,7 +475,7 @@
45
 	    if (fip->field_type == TIFF_ASCII)
46
 		    _TIFFsetString((char **)&tv->value, va_arg(ap, char *));
47
 	    else {
48
-                tv->value = _TIFFmalloc(tv_size * tv->count);
49
+                tv->value = _TIFFCheckMalloc(tif, tv_size, tv->count, "Tag Value");
50
 		if (!tv->value) {
51
 		    status = 0;
52
 		    goto end;
53
@@ -563,7 +570,7 @@
54
           }
55
 	}
56
 	if (status) {
57
-		TIFFSetFieldBit(tif, _TIFFFieldWithTag(tif, tag)->field_bit);
58
+		TIFFSetFieldBit(tif, fip->field_bit);
59
 		tif->tif_flags |= TIFF_DIRTYDIRECT;
60
 	}
61
 
62
@@ -572,12 +579,12 @@
63
 	return (status);
64
 badvalue:
65
 	TIFFErrorExt(tif->tif_clientdata, module, "%s: Bad value %d for \"%s\"",
66
-		  tif->tif_name, v, _TIFFFieldWithTag(tif, tag)->field_name);
67
+		  tif->tif_name, v, fip ? fip->field_name : "Unknown");
68
 	va_end(ap);
69
 	return (0);
70
 badvalue32:
71
 	TIFFErrorExt(tif->tif_clientdata, module, "%s: Bad value %ld for \"%s\"",
72
-		   tif->tif_name, v32, _TIFFFieldWithTag(tif, tag)->field_name);
73
+		   tif->tif_name, v32, fip ? fip->field_name : "Unknown");
74
 	va_end(ap);
75
 	return (0);
76
 }
77
@@ -813,12 +820,16 @@
78
              * If the client tries to get a tag that is not valid
79
              * for the image's codec then we'll arrive here.
80
              */
81
+	    /*
82
+	     * dont dereference fip if it's NULL.
83
+	     * -- taviso@google.com 15 Jun 2006
84
+	     */
85
             if( fip == NULL || fip->field_bit != FIELD_CUSTOM )
86
             {
87
 				TIFFErrorExt(tif->tif_clientdata, "_TIFFVGetField",
88
                           "%s: Invalid %stag \"%s\" (not supported by codec)",
89
                           tif->tif_name, isPseudoTag(tag) ? "pseudo-" : "",
90
-                          _TIFFFieldWithTag(tif, tag)->field_name);
91
+                          fip ? fip->field_name : "Unknown");
92
                 ret_val = 0;
93
                 break;
94
             }
95
Index: tiff-3.8.2/libtiff/tif_dirinfo.c
(-)tiff/files/patch-libtiff+tif_dirinfo.c (+25 lines)
Line 0 Link Here
1
CVE-2006-3464,3465
2
===================================================================
3
--- libtiff/tif_dirinfo.c.orig	2008-08-17 13:03:48.958994316 -0400
4
+++ libtiff/tif_dirinfo.c	2008-08-17 13:03:52.890034927 -0400
5
@@ -775,7 +775,8 @@
6
 		TIFFErrorExt(tif->tif_clientdata, "TIFFFieldWithTag",
7
 			  "Internal error, unknown tag 0x%x",
8
                           (unsigned int) tag);
9
-		assert(fip != NULL);
10
+		/* assert(fip != NULL); */
11
+
12
 		/*NOTREACHED*/
13
 	}
14
 	return (fip);
15
@@ -789,7 +790,8 @@
16
 	if (!fip) {
17
 		TIFFErrorExt(tif->tif_clientdata, "TIFFFieldWithName",
18
 			  "Internal error, unknown tag %s", field_name);
19
-		assert(fip != NULL);
20
+		/* assert(fip != NULL); */
21
+		
22
 		/*NOTREACHED*/
23
 	}
24
 	return (fip);
25
Index: tiff-3.8.2/libtiff/tif_dirread.c
(-)tiff/files/patch-libtiff+tif_dirread.c (+322 lines)
Line 0 Link Here
1
CVE-2006-3459,3463,3464,3465 
2
===================================================================
3
--- libtiff/tif_dirread.c.orig	2008-08-17 13:03:48.962994506 -0400
4
+++ libtiff/tif_dirread.c	2008-08-17 13:03:52.890034927 -0400
5
@@ -29,6 +29,9 @@
6
  *
7
  * Directory Read Support Routines.
8
  */
9
+
10
+#include <limits.h>
11
+
12
 #include "tiffiop.h"
13
 
14
 #define	IGNORE	0		/* tag placeholder used below */
15
@@ -81,6 +84,7 @@
16
 	uint16 dircount;
17
 	toff_t nextdiroff;
18
 	int diroutoforderwarning = 0;
19
+	int compressionknown = 0;
20
 	toff_t* new_dirlist;
21
 
22
 	tif->tif_diroff = tif->tif_nextdiroff;
23
@@ -147,13 +151,20 @@
24
 	} else {
25
 		toff_t off = tif->tif_diroff;
26
 
27
-		if (off + sizeof (uint16) > tif->tif_size) {
28
-			TIFFErrorExt(tif->tif_clientdata, module,
29
-			    "%s: Can not read TIFF directory count",
30
-                            tif->tif_name);
31
-			return (0);
32
+		/*
33
+		 * Check for integer overflow when validating the dir_off, otherwise
34
+		 * a very high offset may cause an OOB read and crash the client.
35
+		 * -- taviso@google.com, 14 Jun 2006.
36
+		 */
37
+		if (off + sizeof (uint16) > tif->tif_size || 
38
+			off > (UINT_MAX - sizeof(uint16))) {
39
+				TIFFErrorExt(tif->tif_clientdata, module,
40
+				    "%s: Can not read TIFF directory count",
41
+				    tif->tif_name);
42
+				return (0);
43
 		} else
44
-			_TIFFmemcpy(&dircount, tif->tif_base + off, sizeof (uint16));
45
+			_TIFFmemcpy(&dircount, tif->tif_base + off,
46
+					sizeof (uint16));
47
 		off += sizeof (uint16);
48
 		if (tif->tif_flags & TIFF_SWAB)
49
 			TIFFSwabShort(&dircount);
50
@@ -254,6 +265,7 @@
51
 		while (fix < tif->tif_nfields &&
52
 		       tif->tif_fieldinfo[fix]->field_tag < dp->tdir_tag)
53
 			fix++;
54
+
55
 		if (fix >= tif->tif_nfields ||
56
 		    tif->tif_fieldinfo[fix]->field_tag != dp->tdir_tag) {
57
 
58
@@ -264,17 +276,23 @@
59
 						       dp->tdir_tag,
60
 						       dp->tdir_tag,
61
 						       dp->tdir_type);
62
-
63
-                    TIFFMergeFieldInfo(tif,
64
-                                       _TIFFCreateAnonFieldInfo(tif,
65
-						dp->tdir_tag,
66
-						(TIFFDataType) dp->tdir_type),
67
-				       1 );
68
+					/*
69
+					 * creating anonymous fields prior to knowing the compression
70
+					 * algorithm (ie, when the field info has been merged) could cause
71
+					 * crashes with pathological directories.
72
+					 * -- taviso@google.com 15 Jun 2006
73
+					 */
74
+					if (compressionknown)
75
+			                    TIFFMergeFieldInfo(tif, _TIFFCreateAnonFieldInfo(tif, dp->tdir_tag, 
76
+						(TIFFDataType) dp->tdir_type), 1 );
77
+					else goto ignore;
78
+		    
79
                     fix = 0;
80
                     while (fix < tif->tif_nfields &&
81
                            tif->tif_fieldinfo[fix]->field_tag < dp->tdir_tag)
82
 			fix++;
83
 		}
84
+		
85
 		/*
86
 		 * Null out old tags that we ignore.
87
 		 */
88
@@ -326,6 +344,7 @@
89
 				    dp->tdir_type, dp->tdir_offset);
90
 				if (!TIFFSetField(tif, dp->tdir_tag, (uint16)v))
91
 					goto bad;
92
+				else compressionknown++;
93
 				break;
94
 			/* XXX: workaround for broken TIFFs */
95
 			} else if (dp->tdir_type == TIFF_LONG) {
96
@@ -540,6 +559,7 @@
97
 	 * Attempt to deal with a missing StripByteCounts tag.
98
 	 */
99
 	if (!TIFFFieldSet(tif, FIELD_STRIPBYTECOUNTS)) {
100
+		const TIFFFieldInfo* fip = _TIFFFieldWithTag(tif, TIFFTAG_STRIPBYTECOUNTS);
101
 		/*
102
 		 * Some manufacturers violate the spec by not giving
103
 		 * the size of the strips.  In this case, assume there
104
@@ -556,7 +576,7 @@
105
 			"%s: TIFF directory is missing required "
106
 			"\"%s\" field, calculating from imagelength",
107
 			tif->tif_name,
108
-		        _TIFFFieldWithTag(tif,TIFFTAG_STRIPBYTECOUNTS)->field_name);
109
+		        fip ? fip->field_name : "Unknown");
110
 		if (EstimateStripByteCounts(tif, dir, dircount) < 0)
111
 		    goto bad;
112
 /* 
113
@@ -580,6 +600,7 @@
114
 	} else if (td->td_nstrips == 1 
115
                    && td->td_stripoffset[0] != 0 
116
                    && BYTECOUNTLOOKSBAD) {
117
+		const TIFFFieldInfo* fip = _TIFFFieldWithTag(tif, TIFFTAG_STRIPBYTECOUNTS);
118
 		/*
119
 		 * XXX: Plexus (and others) sometimes give a value of zero for
120
 		 * a tag when they don't know what the correct value is!  Try
121
@@ -589,13 +610,14 @@
122
 		TIFFWarningExt(tif->tif_clientdata, module,
123
 	"%s: Bogus \"%s\" field, ignoring and calculating from imagelength",
124
                             tif->tif_name,
125
-		            _TIFFFieldWithTag(tif,TIFFTAG_STRIPBYTECOUNTS)->field_name);
126
+		            fip ? fip->field_name : "Unknown");
127
 		if(EstimateStripByteCounts(tif, dir, dircount) < 0)
128
 		    goto bad;
129
 	} else if (td->td_planarconfig == PLANARCONFIG_CONTIG
130
 		   && td->td_nstrips > 2
131
 		   && td->td_compression == COMPRESSION_NONE
132
 		   && td->td_stripbytecount[0] != td->td_stripbytecount[1]) {
133
+		const TIFFFieldInfo* fip = _TIFFFieldWithTag(tif, TIFFTAG_STRIPBYTECOUNTS);
134
 		/*
135
 		 * XXX: Some vendors fill StripByteCount array with absolutely
136
 		 * wrong values (it can be equal to StripOffset array, for
137
@@ -604,7 +626,7 @@
138
 		TIFFWarningExt(tif->tif_clientdata, module,
139
 	"%s: Wrong \"%s\" field, ignoring and calculating from imagelength",
140
                             tif->tif_name,
141
-		            _TIFFFieldWithTag(tif,TIFFTAG_STRIPBYTECOUNTS)->field_name);
142
+		            fip ? fip->field_name : "Unknown");
143
 		if (EstimateStripByteCounts(tif, dir, dircount) < 0)
144
 		    goto bad;
145
 	}
146
@@ -870,7 +892,13 @@
147
 
148
 	register TIFFDirEntry *dp;
149
 	register TIFFDirectory *td = &tif->tif_dir;
150
-	uint16 i;
151
+	
152
+	/* i is used to iterate over td->td_nstrips, so must be
153
+	 * at least the same width.
154
+	 * -- taviso@google.com 15 Jun 2006
155
+	 */
156
+
157
+	uint32 i;
158
 
159
 	if (td->td_stripbytecount)
160
 		_TIFFfree(td->td_stripbytecount);
161
@@ -947,16 +975,18 @@
162
 static int
163
 CheckDirCount(TIFF* tif, TIFFDirEntry* dir, uint32 count)
164
 {
165
+	const TIFFFieldInfo* fip = _TIFFFieldWithTag(tif, dir->tdir_tag);
166
+
167
 	if (count > dir->tdir_count) {
168
 		TIFFWarningExt(tif->tif_clientdata, tif->tif_name,
169
 	"incorrect count for field \"%s\" (%lu, expecting %lu); tag ignored",
170
-		    _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name,
171
+		    fip ? fip->field_name : "Unknown",
172
 		    dir->tdir_count, count);
173
 		return (0);
174
 	} else if (count < dir->tdir_count) {
175
 		TIFFWarningExt(tif->tif_clientdata, tif->tif_name,
176
 	"incorrect count for field \"%s\" (%lu, expecting %lu); tag trimmed",
177
-		    _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name,
178
+		    fip ? fip->field_name : "Unknown",
179
 		    dir->tdir_count, count);
180
 		return (1);
181
 	}
182
@@ -970,6 +1000,7 @@
183
 TIFFFetchData(TIFF* tif, TIFFDirEntry* dir, char* cp)
184
 {
185
 	int w = TIFFDataWidth((TIFFDataType) dir->tdir_type);
186
+	const TIFFFieldInfo* fip = _TIFFFieldWithTag(tif, dir->tdir_tag);
187
 	tsize_t cc = dir->tdir_count * w;
188
 
189
 	/* Check for overflow. */
190
@@ -1013,7 +1044,7 @@
191
 bad:
192
 	TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
193
 		     "Error fetching data for field \"%s\"",
194
-		     _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name);
195
+		     fip ? fip->field_name : "Unknown");
196
 	return (tsize_t) 0;
197
 }
198
 
199
@@ -1039,10 +1070,12 @@
200
 static int
201
 cvtRational(TIFF* tif, TIFFDirEntry* dir, uint32 num, uint32 denom, float* rv)
202
 {
203
+	const TIFFFieldInfo* fip;
204
 	if (denom == 0) {
205
+		fip = _TIFFFieldWithTag(tif, dir->tdir_tag);
206
 		TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
207
 		    "%s: Rational with zero denominator (num = %lu)",
208
-		    _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name, num);
209
+		    fip ? fip->field_name : "Unknown", num);
210
 		return (0);
211
 	} else {
212
 		if (dir->tdir_type == TIFF_RATIONAL)
213
@@ -1159,6 +1192,20 @@
214
 static int
215
 TIFFFetchShortPair(TIFF* tif, TIFFDirEntry* dir)
216
 {
217
+	/*
218
+	 * Prevent overflowing the v stack arrays below by performing a sanity
219
+	 * check on tdir_count, this should never be greater than two.
220
+	 * -- taviso@google.com 14 Jun 2006.
221
+	 */
222
+	if (dir->tdir_count > 2) {
223
+		const TIFFFieldInfo* fip = _TIFFFieldWithTag(tif, dir->tdir_tag);
224
+		TIFFWarningExt(tif->tif_clientdata, tif->tif_name,
225
+				"unexpected count for field \"%s\", %lu, expected 2; ignored.",
226
+				fip ? fip->field_name : "Unknown",
227
+				dir->tdir_count);
228
+		return 0;
229
+	}
230
+
231
 	switch (dir->tdir_type) {
232
 		case TIFF_BYTE:
233
 		case TIFF_SBYTE:
234
@@ -1329,14 +1376,15 @@
235
 	case TIFF_DOUBLE:
236
 		return (TIFFFetchDoubleArray(tif, dir, (double*) v));
237
 	default:
238
+		{ const TIFFFieldInfo* fip = _TIFFFieldWithTag(tif, dir->tdir_tag);
239
 		/* TIFF_NOTYPE */
240
 		/* TIFF_ASCII */
241
 		/* TIFF_UNDEFINED */
242
 		TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
243
 			     "cannot read TIFF_ANY type %d for field \"%s\"",
244
 			     dir->tdir_type,
245
-			     _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name);
246
-		return (0);
247
+			     fip ? fip->field_name : "Unknown");
248
+		return (0); }
249
 	}
250
 	return (1);
251
 }
252
@@ -1351,6 +1399,9 @@
253
 	int ok = 0;
254
 	const TIFFFieldInfo* fip = _TIFFFieldWithTag(tif, dp->tdir_tag);
255
 
256
+	if (fip == NULL) {
257
+		return (0);
258
+	}
259
 	if (dp->tdir_count > 1) {		/* array of values */
260
 		char* cp = NULL;
261
 
262
@@ -1493,6 +1544,7 @@
263
 TIFFFetchPerSampleShorts(TIFF* tif, TIFFDirEntry* dir, uint16* pl)
264
 {
265
     uint16 samples = tif->tif_dir.td_samplesperpixel;
266
+    const TIFFFieldInfo* fip;
267
     int status = 0;
268
 
269
     if (CheckDirCount(tif, dir, (uint32) samples)) {
270
@@ -1510,9 +1562,10 @@
271
 
272
             for (i = 1; i < check_count; i++)
273
                 if (v[i] != v[0]) {
274
+				fip = _TIFFFieldWithTag(tif, dir->tdir_tag);
275
 					TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
276
                               "Cannot handle different per-sample values for field \"%s\"",
277
-                              _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name);
278
+                              fip ? fip->field_name : "Unknown");
279
                     goto bad;
280
                 }
281
             *pl = v[0];
282
@@ -1534,6 +1587,7 @@
283
 TIFFFetchPerSampleLongs(TIFF* tif, TIFFDirEntry* dir, uint32* pl)
284
 {
285
     uint16 samples = tif->tif_dir.td_samplesperpixel;
286
+    const TIFFFieldInfo* fip;
287
     int status = 0;
288
 
289
     if (CheckDirCount(tif, dir, (uint32) samples)) {
290
@@ -1551,9 +1605,10 @@
291
                 check_count = samples;
292
             for (i = 1; i < check_count; i++)
293
                 if (v[i] != v[0]) {
294
+				fip = _TIFFFieldWithTag(tif, dir->tdir_tag);
295
 					TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
296
                               "Cannot handle different per-sample values for field \"%s\"",
297
-                              _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name);
298
+                              fip ? fip->field_name : "Unknown");
299
                     goto bad;
300
                 }
301
             *pl = v[0];
302
@@ -1574,6 +1629,7 @@
303
 TIFFFetchPerSampleAnys(TIFF* tif, TIFFDirEntry* dir, double* pl)
304
 {
305
     uint16 samples = tif->tif_dir.td_samplesperpixel;
306
+    const TIFFFieldInfo* fip;
307
     int status = 0;
308
 
309
     if (CheckDirCount(tif, dir, (uint32) samples)) {
310
@@ -1591,9 +1647,10 @@
311
 
312
             for (i = 1; i < check_count; i++)
313
                 if (v[i] != v[0]) {
314
+		    fip = _TIFFFieldWithTag(tif, dir->tdir_tag);
315
                     TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
316
                               "Cannot handle different per-sample values for field \"%s\"",
317
-                              _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name);
318
+                              fip ? fip->field_name : "Unknown");
319
                     goto bad;
320
                 }
321
             *pl = v[0];
322
Index: tiff-3.8.2/libtiff/tif_fax3.c
(-)tiff/files/patch-libtiff+tif_fax3.c (+28 lines)
Line 0 Link Here
1
CVE-2006-3464,3465
2
===================================================================
3
--- libtiff/tif_fax3.c.orig	2008-08-17 13:03:48.970994629 -0400
4
+++ libtiff/tif_fax3.c	2008-08-17 13:03:52.890034927 -0400
5
@@ -1136,6 +1136,7 @@
6
 Fax3VSetField(TIFF* tif, ttag_t tag, va_list ap)
7
 {
8
 	Fax3BaseState* sp = Fax3State(tif);
9
+	const TIFFFieldInfo* fip;
10
 
11
 	assert(sp != 0);
12
 	assert(sp->vsetparent != 0);
13
@@ -1181,7 +1182,13 @@
14
 	default:
15
 		return (*sp->vsetparent)(tif, tag, ap);
16
 	}
17
-	TIFFSetFieldBit(tif, _TIFFFieldWithTag(tif, tag)->field_bit);
18
+	
19
+	if ((fip = _TIFFFieldWithTag(tif, tag))) {
20
+		TIFFSetFieldBit(tif, fip->field_bit);
21
+	} else {
22
+		return (0);
23
+	}
24
+
25
 	tif->tif_flags |= TIFF_DIRTYDIRECT;
26
 	return (1);
27
 }
28
Index: tiff-3.8.2/libtiff/tif_jpeg.c
(-)tiff/files/patch-libtiff+tif_jpeg.c (+122 lines)
Line 0 Link Here
1
CVE-2006-3460,3464,3465
2
===================================================================
3
--- libtiff/tif_jpeg.c.orig	2008-08-17 13:03:48.974994391 -0400
4
+++ libtiff/tif_jpeg.c	2008-08-17 13:03:52.894064968 -0400
5
@@ -722,15 +722,31 @@
6
 		segment_width = TIFFhowmany(segment_width, sp->h_sampling);
7
 		segment_height = TIFFhowmany(segment_height, sp->v_sampling);
8
 	}
9
-	if (sp->cinfo.d.image_width != segment_width ||
10
-	    sp->cinfo.d.image_height != segment_height) {
11
+	if (sp->cinfo.d.image_width < segment_width ||
12
+	    sp->cinfo.d.image_height < segment_height) {
13
 		TIFFWarningExt(tif->tif_clientdata, module,
14
                  "Improper JPEG strip/tile size, expected %dx%d, got %dx%d",
15
                           segment_width, 
16
                           segment_height,
17
                           sp->cinfo.d.image_width, 
18
                           sp->cinfo.d.image_height);
19
+	} 
20
+	
21
+	if (sp->cinfo.d.image_width > segment_width ||
22
+			sp->cinfo.d.image_height > segment_height) {
23
+		/*
24
+		 * This case could be dangerous, if the strip or tile size has been
25
+		 * reported as less than the amount of data jpeg will return, some
26
+		 * potential security issues arise. Catch this case and error out.
27
+		 * -- taviso@google.com 14 Jun 2006
28
+		 */
29
+		TIFFErrorExt(tif->tif_clientdata, module, 
30
+			"JPEG strip/tile size exceeds expected dimensions,"
31
+			"expected %dx%d, got %dx%d", segment_width, segment_height,
32
+			sp->cinfo.d.image_width, sp->cinfo.d.image_height);
33
+		return (0);
34
 	}
35
+
36
 	if (sp->cinfo.d.num_components !=
37
 	    (td->td_planarconfig == PLANARCONFIG_CONTIG ?
38
 	     td->td_samplesperpixel : 1)) {
39
@@ -761,6 +777,22 @@
40
                                     sp->cinfo.d.comp_info[0].v_samp_factor,
41
                                     sp->h_sampling, sp->v_sampling);
42
 
43
+				/*
44
+				 * There are potential security issues here for decoders that
45
+				 * have already allocated buffers based on the expected sampling
46
+				 * factors. Lets check the sampling factors dont exceed what
47
+				 * we were expecting.
48
+				 * -- taviso@google.com 14 June 2006
49
+				 */
50
+				if (sp->cinfo.d.comp_info[0].h_samp_factor > sp->h_sampling ||
51
+					sp->cinfo.d.comp_info[0].v_samp_factor > sp->v_sampling) {
52
+						TIFFErrorExt(tif->tif_clientdata, module,
53
+							"Cannot honour JPEG sampling factors that"
54
+							" exceed those specified.");
55
+						return (0);
56
+				}
57
+
58
+
59
 			    /*
60
 			     * XXX: Files written by the Intergraph software
61
 			     * has different sampling factors stored in the
62
@@ -1521,15 +1553,18 @@
63
 {
64
 	JPEGState *sp = JState(tif);
65
 	
66
-	assert(sp != 0);
67
+	/* assert(sp != 0); */
68
 
69
 	tif->tif_tagmethods.vgetfield = sp->vgetparent;
70
 	tif->tif_tagmethods.vsetfield = sp->vsetparent;
71
 
72
-	if( sp->cinfo_initialized )
73
-	    TIFFjpeg_destroy(sp);	/* release libjpeg resources */
74
-	if (sp->jpegtables)		/* tag value */
75
-		_TIFFfree(sp->jpegtables);
76
+	if (sp != NULL) {
77
+		if( sp->cinfo_initialized )
78
+		    TIFFjpeg_destroy(sp);	/* release libjpeg resources */
79
+		if (sp->jpegtables)		/* tag value */
80
+			_TIFFfree(sp->jpegtables);
81
+	}
82
+
83
 	_TIFFfree(tif->tif_data);	/* release local state */
84
 	tif->tif_data = NULL;
85
 
86
@@ -1541,6 +1576,7 @@
87
 {
88
 	JPEGState* sp = JState(tif);
89
 	TIFFDirectory* td = &tif->tif_dir;
90
+	const TIFFFieldInfo* fip;
91
 	uint32 v32;
92
 
93
 	assert(sp != NULL);
94
@@ -1606,7 +1642,13 @@
95
 	default:
96
 		return (*sp->vsetparent)(tif, tag, ap);
97
 	}
98
-	TIFFSetFieldBit(tif, _TIFFFieldWithTag(tif, tag)->field_bit);
99
+
100
+	if ((fip = _TIFFFieldWithTag(tif, tag))) {
101
+		TIFFSetFieldBit(tif, fip->field_bit);
102
+	} else {
103
+		return (0);
104
+	}
105
+
106
 	tif->tif_flags |= TIFF_DIRTYDIRECT;
107
 	return (1);
108
 }
109
@@ -1726,7 +1768,11 @@
110
 {
111
 	JPEGState* sp = JState(tif);
112
 
113
-	assert(sp != NULL);
114
+	/* assert(sp != NULL); */
115
+	if (sp == NULL) {
116
+		TIFFWarningExt(tif->tif_clientdata, "JPEGPrintDir", "Unknown JPEGState");
117
+		return;
118
+	}
119
 
120
 	(void) flags;
121
 	if (TIFFFieldSet(tif,FIELD_JPEGTABLES))
122
Index: tiff-3.8.2/libtiff/tif_next.c
(-)tiff/files/patch-libtiff+tif_lzw.c (+60 lines)
Line 0 Link Here
1
CVE-2008-2327
2
===================================================================
3
--- libtiff/tif_lzw.c.orig	2008-08-17 13:03:49.090994393 -0400
4
+++ libtiff/tif_lzw.c	2008-08-17 13:03:52.354994400 -0400
5
@@ -237,6 +237,13 @@
6
                     sp->dec_codetab[code].length = 1;
7
                     sp->dec_codetab[code].next = NULL;
8
                 } while (code--);
9
+                /*
10
+                 * Zero-out the unused entries
11
+                 */
12
+                 _TIFFmemset(&sp->dec_codetab[CODE_CLEAR], 0,
13
+                 (CODE_FIRST-CODE_CLEAR)*sizeof (code_t));
14
+
15
+
16
 	}
17
 	return (1);
18
 }
19
@@ -408,12 +415,20 @@
20
 			break;
21
 		if (code == CODE_CLEAR) {
22
 			free_entp = sp->dec_codetab + CODE_FIRST;
23
+			 _TIFFmemset(free_entp, 0, (CSIZE-CODE_FIRST)*sizeof (code_t));
24
 			nbits = BITS_MIN;
25
 			nbitsmask = MAXCODE(BITS_MIN);
26
 			maxcodep = sp->dec_codetab + nbitsmask-1;
27
 			NextCode(tif, sp, bp, code, GetNextCode);
28
 			if (code == CODE_EOI)
29
 				break;
30
+			 if (code == CODE_CLEAR) {
31
+				 TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
32
+				 "LZWDecode: Corrupted LZW table at scanline %d",
33
+				 tif->tif_row);
34
+				 return (0);
35
+			 }
36
+
37
 			*op++ = (char)code, occ--;
38
 			oldcodep = sp->dec_codetab + code;
39
 			continue;
40
@@ -604,12 +619,20 @@
41
 			break;
42
 		if (code == CODE_CLEAR) {
43
 			free_entp = sp->dec_codetab + CODE_FIRST;
44
+			 _TIFFmemset(free_entp, 0, (CSIZE-CODE_FIRST)*sizeof (code_t));
45
 			nbits = BITS_MIN;
46
 			nbitsmask = MAXCODE(BITS_MIN);
47
 			maxcodep = sp->dec_codetab + nbitsmask;
48
 			NextCode(tif, sp, bp, code, GetNextCodeCompat);
49
 			if (code == CODE_EOI)
50
 				break;
51
+			 if (code == CODE_CLEAR) {
52
+				 TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
53
+				 "LZWDecode: Corrupted LZW table at scanline %d",
54
+				 tif->tif_row);
55
+				 return (0);
56
+			 }
57
+
58
 			*op++ = code, occ--;
59
 			oldcodep = sp->dec_codetab + code;
60
 			continue;
(-)tiff/files/patch-libtiff+tif_next.c (+23 lines)
Line 0 Link Here
1
CVE-2006-3462
2
===================================================================
3
--- libtiff/tif_next.c.orig	2008-08-17 13:03:48.978994352 -0400
4
+++ libtiff/tif_next.c	2008-08-17 13:03:52.894064968 -0400
5
@@ -105,11 +105,16 @@
6
 			 * as codes of the form <color><npixels>
7
 			 * until we've filled the scanline.
8
 			 */
9
+			/*
10
+			 * Ensure the run does not exceed the scanline
11
+			 * bounds, potentially resulting in a security issue.
12
+			 * -- taviso@google.com 14 Jun 2006.
13
+			 */
14
 			op = row;
15
 			for (;;) {
16
 				grey = (n>>6) & 0x3;
17
 				n &= 0x3f;
18
-				while (n-- > 0)
19
+				while (n-- > 0 && npixels < imagewidth)
20
 					SETPIXEL(op, grey);
21
 				if (npixels >= (int) imagewidth)
22
 					break;
23
Index: tiff-3.8.2/libtiff/tif_pixarlog.c
(-)tiff/files/patch-libtiff+tif_pixarlog.c (+26 lines)
Line 0 Link Here
1
CVE-2006-3461
2
===================================================================
3
--- libtiff/tif_pixarlog.c.orig	2008-08-17 13:03:48.986994374 -0400
4
+++ libtiff/tif_pixarlog.c	2008-08-17 13:03:52.894064968 -0400
5
@@ -768,7 +768,19 @@
6
 	if (tif->tif_flags & TIFF_SWAB)
7
 		TIFFSwabArrayOfShort(up, nsamples);
8
 
9
-	for (i = 0; i < nsamples; i += llen, up += llen) {
10
+	/* 
11
+	 * if llen is not an exact multiple of nsamples, the decode operation
12
+	 * may overflow the output buffer, so truncate it enough to prevent that
13
+	 * but still salvage as much data as possible.
14
+	 * -- taviso@google.com 14th June 2006
15
+	 */
16
+	if (nsamples % llen) 
17
+		TIFFWarningExt(tif->tif_clientdata, module,
18
+				"%s: stride %lu is not a multiple of sample count, "
19
+				"%lu, data truncated.", tif->tif_name, llen, nsamples);
20
+				
21
+	
22
+	for (i = 0; i < nsamples - (nsamples % llen); i += llen, up += llen) {
23
 		switch (sp->user_datafmt)  {
24
 		case PIXARLOGDATAFMT_FLOAT:
25
 			horizontalAccumulateF(up, llen, sp->stride,
26
Index: tiff-3.8.2/libtiff/tif_read.c
(-)tiff/files/patch-libtiff+tif_print.c (+13 lines)
Line 0 Link Here
1
CVE-2006-3464,3465
2
===================================================================
3
--- libtiff/tif_print.c.orig	2008-08-17 13:03:49.113994690 -0400
4
+++ libtiff/tif_print.c	2008-08-17 13:03:52.201994368 -0400
5
@@ -491,7 +491,7 @@
6
 		} else
7
 			fprintf(fd, "(present)\n");
8
 	}
9
-	if (TIFFFieldSet(tif, FIELD_SUBIFD)) {
10
+	if (TIFFFieldSet(tif, FIELD_SUBIFD) && (td->td_subifd)) {
11
 		fprintf(fd, "  SubIFD Offsets:");
12
 		for (i = 0; i < td->td_nsubifd; i++)
13
 			fprintf(fd, " %5lu", (long) td->td_subifd[i]);
(-)tiff/files/patch-libtiff+tif_read.c (+43 lines)
Line 0 Link Here
1
CVE-2006-3464,3465
2
===================================================================
3
--- libtiff/tif_read.c.orig	2008-08-17 13:03:48.990994211 -0400
4
+++ libtiff/tif_read.c	2008-08-17 13:03:52.898026507 -0400
5
@@ -31,6 +31,8 @@
6
 #include "tiffiop.h"
7
 #include <stdio.h>
8
 
9
+#include <limits.h>
10
+
11
 	int TIFFFillStrip(TIFF*, tstrip_t);
12
 	int TIFFFillTile(TIFF*, ttile_t);
13
 static	int TIFFStartStrip(TIFF*, tstrip_t);
14
@@ -272,7 +274,13 @@
15
 		if ((tif->tif_flags & TIFF_MYBUFFER) && tif->tif_rawdata)
16
 			_TIFFfree(tif->tif_rawdata);
17
 		tif->tif_flags &= ~TIFF_MYBUFFER;
18
-		if ( td->td_stripoffset[strip] + bytecount > tif->tif_size) {
19
+		/*
20
+		 * This sanity check could potentially overflow, causing an OOB read.
21
+		 * verify that offset + bytecount is > offset.
22
+		 * -- taviso@google.com 14 Jun 2006
23
+		 */
24
+		if ( td->td_stripoffset[strip] + bytecount > tif->tif_size ||
25
+			bytecount > (UINT_MAX - td->td_stripoffset[strip])) {
26
 			/*
27
 			 * This error message might seem strange, but it's
28
 			 * what would happen if a read were done instead.
29
@@ -470,7 +478,13 @@
30
 		if ((tif->tif_flags & TIFF_MYBUFFER) && tif->tif_rawdata)
31
 			_TIFFfree(tif->tif_rawdata);
32
 		tif->tif_flags &= ~TIFF_MYBUFFER;
33
-		if ( td->td_stripoffset[tile] + bytecount > tif->tif_size) {
34
+		/*
35
+		 * We must check this calculation doesnt overflow, potentially
36
+		 * causing an OOB read.
37
+		 * -- taviso@google.com 15 Jun 2006
38
+		 */
39
+		if (td->td_stripoffset[tile] + bytecount > tif->tif_size ||
40
+			bytecount > (UINT_MAX - td->td_stripoffset[tile])) {
41
 			tif->tif_curtile = NOTILE;
42
 			return (0);
43
 		}
(-)tiff/files/patch-man+TIFFClose.3tiff (+11 lines)
Line 0 Link Here
1
--- man/TIFFClose.3tiff.orig	2008-08-17 13:03:49.058994404 -0400
2
+++ man/TIFFClose.3tiff	2008-08-17 13:03:52.522727821 -0400
3
@@ -40,7 +40,7 @@
4
 current directory (if modified); and all resources are reclaimed.
5
 .SH DIAGNOSTICS
6
 All error messages are directed to the
7
-.bR TIFFError (3TIFF)
8
+.BR TIFFError (3TIFF)
9
 routine.
10
 Likewise, warning messages are directed to the
11
 .BR TIFFWarning (3TIFF)
(-)tiff/files/patch-man+fax2ps.1 (+74 lines)
Line 0 Link Here
1
--- man/fax2ps.1.orig	2008-08-17 13:03:49.038994710 -0400
2
+++ man/fax2ps.1	2008-08-17 13:03:52.510994390 -0400
3
@@ -27,7 +27,7 @@
4
 .SH NAME
5
 fax2ps \- convert a
6
 .SM TIFF
7
-facsimile to compressed \*(Ps\(tm
8
+facsimile to compressed PostScript\(tm
9
 .SH SYNOPSIS
10
 .B fax2ps
11
 [
12
@@ -40,7 +40,7 @@
13
 reads one or more
14
 .SM TIFF
15
 facsimile image files and prints a compressed form of
16
-\*(Ps on the standard output that is suitable for printing.
17
+PostScript on the standard output that is suitable for printing.
18
 .PP
19
 By default, each page is scaled to reflect the
20
 image dimensions and resolutions stored in the file.
21
@@ -62,26 +62,26 @@
22
 .PP
23
 By default
24
 .I fax2ps
25
-generates \*(Ps for all pages in the file.
26
+generates PostScript for all pages in the file.
27
 The
28
 .B \-p
29
 option can be used to select one or more pages from
30
 a multi-page document.
31
 .PP
32
 .I fax2ps
33
-generates a compressed form of \*(Ps that is
34
-optimized for sending pages of text to a \*(Ps
35
+generates a compressed form of PostScript that is
36
+optimized for sending pages of text to a PostScript
37
 printer attached to a host through a low-speed link (such
38
 as a serial line).
39
 Each output page is filled with white and then only
40
 the black areas are drawn.
41
-The \*(Ps specification of the black drawing operations
42
+The PostScript specification of the black drawing operations
43
 is optimized by using a special font that encodes the
44
 move-draw operations required to fill
45
 the black regions on the page.
46
 This compression scheme typically results in a substantially
47
-reduced \*(Ps description, relative to the straightforward
48
-imaging of the page with a \*(Ps
49
+reduced PostScript description, relative to the straightforward
50
+imaging of the page with a PostScript
51
 .I image
52
 operator.
53
 This algorithm can, however, be ineffective
54
@@ -138,9 +138,9 @@
55
 attempts to recover from such data errors by resynchronizing
56
 decoding at the end of the current scanline.
57
 This can result in long horizontal black lines in the resultant
58
-\*(Ps image.
59
+PostScript image.
60
 .SH NOTES
61
-If the destination printer supports \*(Ps Level II then
62
+If the destination printer supports PostScript Level II then
63
 it is always faster to just send the encoded bitmap generated
64
 by the
65
 .BR tiff2ps (1)
66
@@ -149,7 +149,7 @@
67
 .I fax2ps
68
 should probably figure out when it is doing a poor
69
 job of compressing the output and just generate 
70
-\*(Ps to image the bitmap raster instead.
71
+PostScript to image the bitmap raster instead.
72
 .SH "SEE ALSO"
73
 .BR tiff2ps (1),
74
 .BR libtiff (3)
(-)tiff/files/patch-man+raw2tiff.1 (+11 lines)
Line 0 Link Here
1
--- man/raw2tiff.1.orig	2008-08-17 13:03:49.042994359 -0400
2
+++ man/raw2tiff.1	2008-08-17 13:03:52.519034963 -0400
3
@@ -184,7 +184,7 @@
4
 in some cases. But for most ordinary images guessing method will work fine.
5
 .SH "SEE ALSO"
6
 .BR pal2rgb (1),
7
-.bR tiffinfo (1),
8
+.BR tiffinfo (1),
9
 .BR tiffcp (1),
10
 .BR tiffmedian (1),
11
 .BR libtiff (3)
(-)tiff/files/patch-man+tiff2pdf.1 (+34 lines)
Line 0 Link Here
1
--- man/tiff2pdf.1.orig	2008-08-17 13:03:49.046994376 -0400
2
+++ man/tiff2pdf.1	2008-08-17 13:03:52.522727821 -0400
3
@@ -207,18 +207,14 @@
4
 The following example would generate the file output.pdf from input.tiff.
5
 .PP
6
 .RS
7
-.NF
8
-tiff2pdf -o output.pdf input.tiff
9
-.FI
10
+\f(CWtiff2pdf -o output.pdf input.tiff\fP
11
 .RE
12
 .PP
13
 The following example would generate PDF output from input.tiff and write it 
14
 to standard output.
15
 .PP
16
 .RS
17
-.NF
18
-tiff2pdf input.tiff
19
-.FI
20
+\f(CWtiff2pdf input.tiff\fP
21
 .RE
22
 .PP
23
 The following example would generate the file output.pdf from input.tiff, 
24
@@ -227,9 +223,7 @@
25
 the "Fit Window" option.
26
 .PP
27
 .RS
28
-.NF
29
-tiff2pdf -p letter -j -q 75 -t "Document" -f -o output.pdf input.tiff
30
-.FI
31
+\f(CWtiff2pdf -p letter -j -q 75 -t "Document" -f -o output.pdf input.tiff\f)
32
 .RE
33
 .SH BUGS
34
 Please report bugs via the web interface at 
(-)tiff/files/patch-man+tiff2ps.1 (+142 lines)
Line 0 Link Here
1
--- man/tiff2ps.1.orig	2008-08-17 13:03:49.050994382 -0400
2
+++ man/tiff2ps.1	2008-08-17 13:03:52.522727821 -0400
3
@@ -27,7 +27,7 @@
4
 .SH NAME
5
 tiff2ps \- convert a
6
 .SM TIFF
7
-image to \*(Ps\(tm
8
+image to PostScript\(tm
9
 .SH SYNOPSIS
10
 .B tiff2ps
11
 [
12
@@ -38,17 +38,17 @@
13
 .I tiff2ps
14
 reads
15
 .SM TIFF
16
-images and writes \*(Ps or Encapsulated \*(Ps (EPS)
17
+images and writes PostScript or Encapsulated PostScript (EPS)
18
 on the standard output.
19
 By default,
20
 .I tiff2ps
21
-writes Encapsulated \*(Ps for the first image in the specified
22
+writes Encapsulated PostScript for the first image in the specified
23
 .SM TIFF
24
 image file.
25
 .PP
26
 By default,
27
 .I tiff2ps
28
-will generate \*(Ps that fills a printed area specified
29
+will generate PostScript that fills a printed area specified
30
 by the 
31
 .SM TIFF
32
 tags in the input file.
33
@@ -67,22 +67,22 @@
34
 .SM TIFF
35
 tags.
36
 .PP
37
-The \*(Ps generated for
38
+The PostScript generated for
39
 .SM RGB,
40
 palette, and
41
 .SM CMYK
42
 images uses the
43
 .I colorimage
44
 operator.
45
-The \*(Ps generated for
46
+The PostScript generated for
47
 greyscale and bilevel images
48
 uses the
49
 .I image
50
 operator.
51
 When the
52
 .I colorimage
53
-operator is used, \*(Ps code to emulate this operator
54
-on older \*(Ps printers is also generated.
55
+operator is used, PostScript code to emulate this operator
56
+on older PostScript printers is also generated.
57
 Note that this emulation code can be very slow.
58
 .PP
59
 Color images with associated alpha data are composited over
60
@@ -90,13 +90,13 @@
61
 .SH OPTIONS
62
 .TP
63
 .B \-1
64
-Generate \*(Ps Level 1 (the default).
65
+Generate PostScript Level 1 (the default).
66
 .TP
67
 .B \-2
68
-Generate \*(Ps Level 2.
69
+Generate PostScript Level 2.
70
 .TP
71
 .B \-3
72
-Generate \*(Ps Level 3. It basically allows one to use the /flateDecode
73
+Generate PostScript Level 3. It basically allows one to use the /flateDecode
74
 filter for ZIP compressed TIFF images.
75
 .TP
76
 .B \-a
77
@@ -119,7 +119,7 @@
78
 multi-page (e.g. facsimile) file.
79
 .TP
80
 .B \-e
81
-Force the generation of Encapsulated \*(Ps (implies -z).
82
+Force the generation of Encapsulated PostScript (implies -z).
83
 .TP
84
 .B \-h
85
 Specify the vertical size of the printed area (in inches).
86
@@ -148,7 +148,7 @@
87
 .B \-m
88
 Where possible render using the
89
 .B imagemask
90
-\*(Ps operator instead of the image operator.  When this option is specified
91
+PostScript operator instead of the image operator.  When this option is specified
92
 .I tiff2ps
93
 will use
94
 .B imagemask
95
@@ -166,7 +166,7 @@
96
 like which are hidden using the SubIFD tag.
97
 .TP
98
 .B \-p
99
-Force the generation of (non-Encapsulated) \*(Ps.
100
+Force the generation of (non-Encapsulated) PostScript.
101
 .TP
102
 .B \-r
103
 Rotate image by 180 degrees.
104
@@ -184,15 +184,15 @@
105
 Override resolution units specified in the TIFF as inches.
106
 .TP
107
 .B \-z
108
-When generating \*(Ps Level 2, data is scaled so that it does not
109
+When generating PostScript Level 2, data is scaled so that it does not
110
 image into the 
111
 .I deadzone
112
 on a page (the outer margin that the printing device is unable to mark).
113
 This option suppresses this behavior.
114
-When \*(Ps Level 1 is generated, data is imaged to the entire printed
115
+When PostScript Level 1 is generated, data is imaged to the entire printed
116
 page and this option has no affect.
117
 .SH EXAMPLES
118
-The following generates \*(Ps Level 2 for all pages of a facsimile:
119
+The following generates PostScript Level 2 for all pages of a facsimile:
120
 .RS
121
 .nf
122
 tiff2ps -a2 fax.tif | lpr
123
@@ -201,7 +201,7 @@
124
 Note also that if you have version 2.6.1 or newer of Ghostscript then you
125
 can efficiently preview facsimile generated with the above command.
126
 .PP
127
-To generate Encapsulated \*(Ps for a the image at directory 2
128
+To generate Encapsulated PostScript for a the image at directory 2
129
 of an image use:
130
 .RS
131
 .nf
132
@@ -228,8 +228,8 @@
133
 .B \-L.5
134
 option says to repeat a half inch on the next page (to improve readability).
135
 .SH BUGS
136
-Because \*(Ps does not support the notion of a colormap,
137
-8-bit palette images produce 24-bit \*(Ps images.
138
+Because PostScript does not support the notion of a colormap,
139
+8-bit palette images produce 24-bit PostScript images.
140
 This conversion results in output that is six times
141
 bigger than the original image and which takes a long time
142
 to send to a printer over a serial line.
(-)tiff/files/patch-man+tiffcmp.1 (+11 lines)
Line 0 Link Here
1
--- man/tiffcmp.1.orig	2008-08-17 13:03:49.062994301 -0400
2
+++ man/tiffcmp.1	2008-08-17 13:03:52.522727821 -0400
3
@@ -77,7 +77,7 @@
4
 in some exotic cases. 
5
 .SH "SEE ALSO"
6
 .BR pal2rgb (1),
7
-.bR tiffinfo (1),
8
+.BR tiffinfo (1),
9
 .BR tiffcp (1),
10
 .BR tiffmedian (1),
11
 .BR libtiff (3TIFF)
(-)tiff/files/patch-man+tiffsplit.1 (+11 lines)
Line 0 Link Here
1
--- man/tiffsplit.1.orig	2008-08-17 13:03:49.070994233 -0400
2
+++ man/tiffsplit.1	2008-08-17 13:03:52.522727821 -0400
3
@@ -50,7 +50,7 @@
4
 (e.g. 
5
 .IR xaaa.tif ,
6
 .IR xaab.tif ,
7
-\...
8
+.IR ... ,
9
 .IR xzzz.tif ).
10
 If a prefix is not specified on the command line,
11
 the default prefix of
(-)tiff/files/patch-tools+tiff2pdf.c (+13 lines)
Line 0 Link Here
1
CVE-2006-2193
2
===================================================================
3
--- tools/tiff2pdf.c.orig	2006-06-04 18:26:40.000000000 -0700
4
+++ tools/tiff2pdf.c	2006-06-04 18:27:22.000000000 -0700
5
@@ -3668,7 +3668,7 @@
6
 	written += TIFFWriteFile(output, (tdata_t) "(", 1);
7
 	for (i=0;i<len;i++){
8
 		if((pdfstr[i]&0x80) || (pdfstr[i]==127) || (pdfstr[i]<32)){
9
-			sprintf(buffer, "\\%.3o", pdfstr[i]);
10
+			snprintf(buffer, "\\%.3o", pdfstr[i]);
11
 			written += TIFFWriteFile(output, (tdata_t) buffer, 4);
12
 		} else {
13
 			switch (pdfstr[i]){
(-)tiff/files/patch-tools+tiffsplit.c (+21 lines)
Line 0 Link Here
1
CVE-2006-2656
2
===================================================================
3
--- tools/tiffsplit.c.orig	2008-08-17 13:03:49.014994263 -0400
4
+++ tools/tiffsplit.c	2008-08-17 13:03:52.726994578 -0400
5
@@ -61,14 +61,13 @@
6
 		return (-3);
7
 	}
8
 	if (argc > 2)
9
-		strcpy(fname, argv[2]);
10
+		snprintf(fname, sizeof(fname), "%s", argv[2]);
11
 	in = TIFFOpen(argv[1], "r");
12
 	if (in != NULL) {
13
 		do {
14
 			char path[1024+1];
15
 			newfilename();
16
-			strcpy(path, fname);
17
-			strcat(path, ".tif");
18
+			snprintf(path, sizeof(path), "%s.tif", fname);
19
 			out = TIFFOpen(path, TIFFIsBigEndian(in)?"wb":"wl");
20
 			if (out == NULL)
21
 				return (-2);

Return to bug 127434