|
|
0e6869 |
Teach "tiffinfo -D" to not try to print image data inside an EXIF subdirectory,
|
|
|
0e6869 |
because there isn't any. Back-patched from an upstream 4.0.2 fix.
|
|
|
0e6869 |
|
|
|
0e6869 |
This is not a security issue in itself (it crashes, but with a simple NULL
|
|
|
0e6869 |
pointer dereference). However, our test case for CVE-2012-5581 tickles this
|
|
|
0e6869 |
bug, so it seems easier to fix this than make a new test case.
|
|
|
0e6869 |
|
|
|
0e6869 |
|
|
|
0e6869 |
diff -Naur tiff-3.9.4.orig/tools/tiffinfo.c tiff-3.9.4/tools/tiffinfo.c
|
|
|
0e6869 |
--- tiff-3.9.4.orig/tools/tiffinfo.c 2010-06-08 14:50:44.000000000 -0400
|
|
|
0e6869 |
+++ tiff-3.9.4/tools/tiffinfo.c 2012-12-11 16:33:17.062228558 -0500
|
|
|
0e6869 |
@@ -49,7 +49,7 @@
|
|
|
0e6869 |
int stoponerr = 1; /* stop on first read error */
|
|
|
0e6869 |
|
|
|
0e6869 |
static void usage(void);
|
|
|
0e6869 |
-static void tiffinfo(TIFF*, uint16, long);
|
|
|
0e6869 |
+static void tiffinfo(TIFF*, uint16, long, int);
|
|
|
0e6869 |
|
|
|
0e6869 |
int
|
|
|
0e6869 |
main(int argc, char* argv[])
|
|
|
0e6869 |
@@ -124,19 +124,20 @@
|
|
|
0e6869 |
if (tif != NULL) {
|
|
|
0e6869 |
if (dirnum != -1) {
|
|
|
0e6869 |
if (TIFFSetDirectory(tif, (tdir_t) dirnum))
|
|
|
0e6869 |
- tiffinfo(tif, order, flags);
|
|
|
0e6869 |
+ tiffinfo(tif, order, flags, 1);
|
|
|
0e6869 |
} else if (diroff != 0) {
|
|
|
0e6869 |
if (TIFFSetSubDirectory(tif, diroff))
|
|
|
0e6869 |
- tiffinfo(tif, order, flags);
|
|
|
0e6869 |
+ tiffinfo(tif, order, flags, 1);
|
|
|
0e6869 |
} else {
|
|
|
0e6869 |
do {
|
|
|
0e6869 |
uint32 offset;
|
|
|
0e6869 |
|
|
|
0e6869 |
- tiffinfo(tif, order, flags);
|
|
|
0e6869 |
+ tiffinfo(tif, order, flags, 1);
|
|
|
0e6869 |
if (TIFFGetField(tif, TIFFTAG_EXIFIFD,
|
|
|
0e6869 |
&offset)) {
|
|
|
0e6869 |
- if (TIFFReadEXIFDirectory(tif, offset))
|
|
|
0e6869 |
- tiffinfo(tif, order, flags);
|
|
|
0e6869 |
+ if (TIFFReadEXIFDirectory(tif, offset)) {
|
|
|
0e6869 |
+ tiffinfo(tif, order, flags, 0);
|
|
|
0e6869 |
+ }
|
|
|
0e6869 |
}
|
|
|
0e6869 |
} while (TIFFReadDirectory(tif));
|
|
|
0e6869 |
}
|
|
|
0e6869 |
@@ -426,10 +427,10 @@
|
|
|
0e6869 |
}
|
|
|
0e6869 |
|
|
|
0e6869 |
static void
|
|
|
0e6869 |
-tiffinfo(TIFF* tif, uint16 order, long flags)
|
|
|
0e6869 |
+tiffinfo(TIFF* tif, uint16 order, long flags, int is_image)
|
|
|
0e6869 |
{
|
|
|
0e6869 |
TIFFPrintDirectory(tif, stdout, flags);
|
|
|
0e6869 |
- if (!readdata)
|
|
|
0e6869 |
+ if (!readdata || !is_image)
|
|
|
0e6869 |
return;
|
|
|
0e6869 |
if (rawdata) {
|
|
|
0e6869 |
if (order) {
|