File ImageMagick-CVE-2017-12587.patch of Package ImageMagick.8212

From d4192df5eb03892089806d52a317cc3101856726 Mon Sep 17 00:00:00 2001
From: Cristy <urban-warrior@imagemagick.org>
Date: Tue, 4 Jul 2017 10:09:53 -0400
Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/535

---
 coders/pwp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/coders/pwp.c b/coders/pwp.c
index b83eaf41fb..a5b3e8f69c 100644
--- a/coders/pwp.c
+++ b/coders/pwp.c
@@ -216,6 +216,8 @@ static Image *ReadPWPImage(const ImageInfo *image_info,ExceptionInfo *exception)
     for (i=0; i < (ssize_t) filesize; i++)
     {
       c=ReadBlobByte(pwp_image);
+      if (c == EOF)
+        break;
       (void) fputc(c,file);
     }
     (void) fclose(file);