summaryrefslogtreecommitdiff
path: root/graphics/tiff/files/patch-tiffsplit.c
blob: ea75a024ce850b0b1f4615fba5bb165ca9f5e275 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
CVE-2006-2656
===================================================================
--- tools/tiffsplit.c.orig	2008-08-17 13:03:49.014994263 -0400
+++ tools/tiffsplit.c	2008-08-17 13:03:52.726994578 -0400
@@ -61,14 +61,13 @@
 		return (-3);
 	}
 	if (argc > 2)
-		strcpy(fname, argv[2]);
+		snprintf(fname, sizeof(fname), "%s", argv[2]);
 	in = TIFFOpen(argv[1], "r");
 	if (in != NULL) {
 		do {
 			char path[1024+1];
 			newfilename();
-			strcpy(path, fname);
-			strcat(path, ".tif");
+			snprintf(path, sizeof(path), "%s.tif", fname);
 			out = TIFFOpen(path, TIFFIsBigEndian(in)?"wb":"wl");
 			if (out == NULL)
 				return (-2);