From 01efa16789b896c3e1fec60c0e5196fcf80cfcd9 Mon Sep 17 00:00:00 2001 From: Cristy Date: Mon, 30 Jan 2017 16:41:30 -0500 Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/368 --- ChangeLog | 4 ++++ coders/miff.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 73d3963b6..e02e90553 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2017-01-28 7.0.4-7 Cristy + * Sanitize comments that include braces for the MIFF image format (reference + https://github.com/ImageMagick/ImageMagick/issues/368). + 2017-01-27 7.0.4-7 Glenn Randers-Pehrson * coders/png.c: Added support for a proposed new PNG chunk (zxIf, read-only) that is currently being discussed on the diff --git a/coders/miff.c b/coders/miff.c index 954df7c56..e33eafbab 100644 --- a/coders/miff.c +++ b/coders/miff.c @@ -2274,7 +2274,8 @@ static MagickBooleanType WriteMIFFImage(const ImageInfo *image_info, length=strlen(value); for (i=0; i < (ssize_t) length; i++) - if (isspace((int) ((unsigned char) value[i])) != 0) + if ((isspace((int) ((unsigned char) value[i])) != 0) || + (value[i] == '}')) break; if ((i == (ssize_t) length) && (i != 0)) (void) WriteBlob(image,length,(const unsigned char *) value); -- 2.40.0