File GraphicsMagick-CVE-2016-9559.patch of Package GraphicsMagick.6323
From b61d35eaccc0a7ddeff8a1c3abfcd0a43ccf210b Mon Sep 17 00:00:00 2001
From: Cristy <urban-warrior@imagemagick.org>
Date: Wed, 9 Nov 2016 15:57:28 -0500
Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/298
---
MagickCore/property.c | 4 ++--
coders/tiff.c | 43 ++++++++++++++++++++++++++++---------------
coders/txt.c | 3 +--
3 files changed, 31 insertions(+), 19 deletions(-)
Index: GraphicsMagick-1.3.20/coders/tiff.c
===================================================================
--- GraphicsMagick-1.3.20.orig/coders/tiff.c 2016-11-28 12:38:37.780341823 +0100
+++ GraphicsMagick-1.3.20/coders/tiff.c 2016-11-28 12:39:13.468935074 +0100
@@ -1727,31 +1727,31 @@ ReadTIFFImage(const ImageInfo *image_inf
if (TIFFGetField(tiff,TIFFTAG_ARTIST,&text) == 1)
(void) SetImageAttribute(image,"artist",text);
- if (TIFFGetField(tiff,TIFFTAG_COPYRIGHT,&text) == 1) /* TIFFTAG_COPYRIGHT */
+ if (TIFFGetField(tiff,TIFFTAG_COPYRIGHT,&text) == 1 && (text != (char *) NULL)) /* TIFFTAG_COPYRIGHT */
(void) SetImageAttribute(image,"copyright",text);
- if (TIFFGetField(tiff,TIFFTAG_DATETIME,&text) == 1)
+ if (TIFFGetField(tiff,TIFFTAG_DATETIME,&text) == 1 && (text != (char *) NULL))
(void) SetImageAttribute(image,"timestamp",text);
- if (TIFFGetField(tiff,TIFFTAG_DOCUMENTNAME,&text) == 1)
+ if (TIFFGetField(tiff,TIFFTAG_DOCUMENTNAME,&text) == 1 && (text != (char *) NULL))
(void) SetImageAttribute(image,"document",text);
- if (TIFFGetField(tiff,TIFFTAG_HOSTCOMPUTER,&text) == 1)
+ if (TIFFGetField(tiff,TIFFTAG_HOSTCOMPUTER,&text) == 1 && (text != (char *) NULL))
(void) SetImageAttribute(image,"hostcomputer",text);
- if (TIFFGetField(tiff,TIFFTAG_IMAGEDESCRIPTION,&text) == 1)
+ if (TIFFGetField(tiff,TIFFTAG_IMAGEDESCRIPTION,&text) == 1 && (text != (char *) NULL))
(void) SetImageAttribute(image,"comment",text);
- if (TIFFGetField(tiff,TIFFTAG_MAKE,&text) == 1)
+ if (TIFFGetField(tiff,TIFFTAG_MAKE,&text) == 1 && (text != (char *) NULL))
(void) SetImageAttribute(image,"make",text);
- if (TIFFGetField(tiff,TIFFTAG_MODEL,&text) == 1)
+ if (TIFFGetField(tiff,TIFFTAG_MODEL,&text) == 1 && (text != (char *) NULL))
(void) SetImageAttribute(image,"model",text);
- if (TIFFGetField(tiff,TIFFTAG_PAGENAME,&text) == 1)
+ if (TIFFGetField(tiff,TIFFTAG_PAGENAME,&text) == 1 && (text != (char *) NULL))
(void) SetImageAttribute(image,"label",text);
- if (TIFFGetField(tiff,TIFFTAG_SOFTWARE,&text) == 1)
+ if (TIFFGetField(tiff,TIFFTAG_SOFTWARE,&text) == 1 && (text != (char *) NULL))
(void) SetImageAttribute(image,"software",text);
/*