File ImageMagick-CVE-2017-16352.patch of Package ImageMagick.30956
Index: ImageMagick-6.4.3/magick/identify.c
===================================================================
--- ImageMagick-6.4.3.orig/magick/identify.c 2008-08-26 19:07:54.000000000 +0200
+++ ImageMagick-6.4.3/magick/identify.c 2018-02-27 19:01:37.467676498 +0100
@@ -685,7 +685,7 @@ MagickExport MagickBooleanType IdentifyI
for (p=image->directory; *p != '\0'; p++)
{
q=p;
- while ((*q != '\n') && (*q != '\0'))
+ while ((*q != '\n') && (*q != '\0') && ((size_t) (q-p) < sizeof(image_info->filename)))
q++;
(void) CopyMagickString(image_info->filename,p,(size_t) (q-p+1));
p=q;