Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Alexander_Naumov:SLE-12:Update
ImageMagick.17345
ImageMagick-CVE-2016-8683.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File ImageMagick-CVE-2016-8683.patch of Package ImageMagick.17345
Index: ImageMagick-6.8.9-8/coders/pcx.c =================================================================== --- ImageMagick-6.8.9-8.orig/coders/pcx.c 2016-10-18 14:55:38.757820367 +0200 +++ ImageMagick-6.8.9-8/coders/pcx.c 2016-10-18 14:57:04.087115909 +0200 @@ -279,6 +279,9 @@ static Image *ReadPCXImage(const ImageIn *pixels, *scanline; + off_t + file_size; + /* Open image file. */ @@ -328,6 +331,7 @@ static Image *ReadPCXImage(const ImageIn if (offset < 0) ThrowReaderException(CorruptImageError,"ImproperImageHeader"); } + file_size=GetBlobSize(image); count=ReadBlob(image,1,&pcx_info.identifier); for (id=1; id < 1024; id++) { @@ -395,6 +399,33 @@ static Image *ReadPCXImage(const ImageIn if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0)) if (image->scene >= (image_info->scene+image_info->number_scenes-1)) break; + + /* + Check that filesize is reasonable given header + */ + { + double + uncompressed_size; + + uncompressed_size=((double) image->rows*pcx_info.bytes_per_line*pcx_info.planes); + (void) LogMagickEvent(CoderEvent,GetMagickModule(), + "Uncompressed size: %.0f", uncompressed_size); + if (pcx_info.encoding == 0) + { + /* Not compressed */ + if (uncompressed_size > file_size) + ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile" + ); + } + else + { + /* RLE compressed */ + if (uncompressed_size > file_size*254.0) + ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile" + ); + } + } + /* Read image data. */
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor