summaryrefslogtreecommitdiff
path: root/source/l/libtiff/tiff-3.8.2.tiffsplit.commandline.overflow.diff
diff options
context:
space:
mode:
Diffstat (limited to 'source/l/libtiff/tiff-3.8.2.tiffsplit.commandline.overflow.diff')
-rw-r--r--source/l/libtiff/tiff-3.8.2.tiffsplit.commandline.overflow.diff22
1 files changed, 22 insertions, 0 deletions
diff --git a/source/l/libtiff/tiff-3.8.2.tiffsplit.commandline.overflow.diff b/source/l/libtiff/tiff-3.8.2.tiffsplit.commandline.overflow.diff
new file mode 100644
index 00000000..feb693fa
--- /dev/null
+++ b/source/l/libtiff/tiff-3.8.2.tiffsplit.commandline.overflow.diff
@@ -0,0 +1,22 @@
+--- ./tools/tiffsplit.c.orig 2005-12-07 03:48:33.000000000 -0600
++++ ./tools/tiffsplit.c 2006-08-17 22:03:36.000000000 -0500
+@@ -60,14 +60,16 @@
+ fprintf(stderr, "usage: tiffsplit input.tif [prefix]\n");
+ return (-3);
+ }
+- if (argc > 2)
+- strcpy(fname, argv[2]);
++ if (argc > 2) {
++ strncpy(fname, argv[2], 1024);
++ fname[1024] = '\0';
++ }
+ in = TIFFOpen(argv[1], "r");
+ if (in != NULL) {
+ do {
+ char path[1024+1];
+ newfilename();
+- strcpy(path, fname);
++ strncpy(path, fname, 1020);
+ strcat(path, ".tif");
+ out = TIFFOpen(path, TIFFIsBigEndian(in)?"wb":"wl");
+ if (out == NULL)