From b6643c4ae2dbb63a809c869fc1888831dabc05aa Mon Sep 17 00:00:00 2001 From: Cristy Date: Wed, 21 Mar 2018 20:45:56 -0400 Subject: [PATCH] ... --- ChangeLog | 4 ++++ coders/ept.c | 1 - coders/ps2.c | 27 ++++++++++++++------------- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2c1c25ae5..a50a0542d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2018-03-21 7.0.7-28 + * Fixed numerous use of uninitialized values, integer overflow, memory + exceeded, and timeouts (credit to OSS Fuzz). + 2018-03-18 7.0.7-27 Cristy * Release ImageMagick version 7.0.7-27, GIT revision 23466:734b146df:20180318. diff --git a/coders/ept.c b/coders/ept.c index 80399002f..d9c1153ba 100644 --- a/coders/ept.c +++ b/coders/ept.c @@ -438,7 +438,6 @@ static MagickBooleanType WriteEPTImage(const ImageInfo *image_info,Image *image, if (write_image == (Image *) NULL) return(MagickFalse); write_info=CloneImageInfo(image_info); - *write_info->magick='\0'; (void) CopyMagickString(write_info->magick,"TIFF",MagickPathExtent); (void) FormatLocaleString(filename,MagickPathExtent,"tiff:%s", write_info->filename); diff --git a/coders/ps2.c b/coders/ps2.c index e54e78e19..f4e80f45e 100644 --- a/coders/ps2.c +++ b/coders/ps2.c @@ -710,8 +710,9 @@ static MagickBooleanType WritePS2Image(const ImageInfo *image_info,Image *image, /* Output image data. */ - (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g %.20g\n%g %g\n%g\n", - (double) geometry.x,(double) geometry.y,scale.x,scale.y,pointsize); + (void) FormatLocaleString(buffer,MagickPathExtent, + "%.20g %.20g\n%g %g\n%g\n",(double) geometry.x,(double) geometry.y, + scale.x,scale.y,pointsize); (void) WriteBlobString(image,buffer); labels=(char **) NULL; value=GetImageProperty(image,"label",exception); @@ -735,12 +736,12 @@ static MagickBooleanType WritePS2Image(const ImageInfo *image_info,Image *image, ((image_info->type != TrueColorType) && (SetImageGray(image,exception) != MagickFalse))) { - (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g %.20g\n1\n%d\n", - (double) image->columns,(double) image->rows,(int) - (image->colorspace == CMYKColorspace)); + (void) FormatLocaleString(buffer,MagickPathExtent, + "%.20g %.20g\n1\n%d\n",(double) image->columns,(double) image->rows, + (int) (image->colorspace == CMYKColorspace)); (void) WriteBlobString(image,buffer); - (void) FormatLocaleString(buffer,MagickPathExtent,"%d\n", - (int) ((compression != FaxCompression) && + (void) FormatLocaleString(buffer,MagickPathExtent,"%d\n",(int) + ((compression != FaxCompression) && (compression != Group4Compression))); (void) WriteBlobString(image,buffer); (void) WriteBlobString(image,"0\n"); @@ -851,9 +852,9 @@ static MagickBooleanType WritePS2Image(const ImageInfo *image_info,Image *image, if ((image->storage_class == DirectClass) || (image->colors > 256) || (compression == JPEGCompression) || (image->alpha_trait != UndefinedPixelTrait)) { - (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g %.20g\n0\n%d\n", - (double) image->columns,(double) image->rows,(int) - (image->colorspace == CMYKColorspace)); + (void) FormatLocaleString(buffer,MagickPathExtent, + "%.20g %.20g\n0\n%d\n",(double) image->columns,(double) image->rows, + (int) (image->colorspace == CMYKColorspace)); (void) WriteBlobString(image,buffer); (void) FormatLocaleString(buffer,MagickPathExtent,"%d\n", (int) (compression == NoCompression)); @@ -1001,9 +1002,9 @@ static MagickBooleanType WritePS2Image(const ImageInfo *image_info,Image *image, /* Dump number of colors and colormap. */ - (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g %.20g\n1\n%d\n", - (double) image->columns,(double) image->rows,(int) - (image->colorspace == CMYKColorspace)); + (void) FormatLocaleString(buffer,MagickPathExtent, + "%.20g %.20g\n1\n%d\n",(double) image->columns,(double) image->rows, + (int) (image->colorspace == CMYKColorspace)); (void) WriteBlobString(image,buffer); (void) FormatLocaleString(buffer,MagickPathExtent,"%d\n", (int) (compression == NoCompression)); -- 2.40.0