File ImageMagick-CVE-2015-8900.patch of Package ImageMagick.8768
From 97aa7d7cfd2027f6ba7ce42caf8b798541b9cdc6 Mon Sep 17 00:00:00 2001
From: dirk <dirk@git.imagemagick.org>
Date: Sun, 25 Jan 2015 07:27:09 +0000
Subject: [PATCH] Fixed infinite loop and added checks for the sscanf result.
---
coders/hdr.c | 36 ++++++++++++++++++++----------------
1 file changed, 20 insertions(+), 16 deletions(-)
diff --git a/coders/hdr.c b/coders/hdr.c
index ccea763..cd07f22 100644
--- a/coders/hdr.c
+++ b/coders/hdr.c
@@ -274,7 +274,7 @@ static Image *ReadHDRImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (value_expected == MagickFalse)
continue;
p=value;
- while ((c != '\n') && (c != '\0'))
+ while ((c != '\n') && (c != '\0') && (c != EOF))
{
if ((size_t) (p-value) < (MaxTextExtent-1))
*p++=c;