From: Cristy Date: Sun, 3 Sep 2017 12:03:54 +0000 (-0400) Subject: ... X-Git-Tag: 7.0.7-0~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=69967f4161bd14d8e03ea463d6545da442a6ea78;p=imagemagick ... --- diff --git a/coders/sun.c b/coders/sun.c index 701cc5f4c..b485f74ed 100644 --- a/coders/sun.c +++ b/coders/sun.c @@ -435,6 +435,8 @@ static Image *ReadSUNImage(const ImageInfo *image_info,ExceptionInfo *exception) if (HeapOverflowSanityCheck(sun_info.width,sun_info.depth) != MagickFalse) ThrowReaderException(CorruptImageError,"ImproperImageHeader"); bytes_per_line=sun_info.width*sun_info.depth; + if (sun_info.length > GetBlobSize(image)) + ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile"); sun_data=(unsigned char *) AcquireQuantumMemory(sun_info.length, sizeof(*sun_data)); if (sun_data == (unsigned char *) NULL)