Skip to content
Permalink
Browse files Browse the repository at this point in the history
Prevent buffer overflow (bug report from Ibrahim el-sayed)
  • Loading branch information
Cristy committed Jul 25, 2016
1 parent ae87d4d commit dd84447
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions MagickCore/property.c
Expand Up @@ -665,6 +665,11 @@ static MagickBooleanType Get8BIMProperty(const Image *image,const char *key,
if ((count & 0x01) == 0)
(void) ReadPropertyByte(&info,&length);
count=(ssize_t) ReadPropertyMSBLong(&info,&length);
if ((count < 0) || ((size_t) count > length))
{
length=0;
continue;
}
if ((*name != '\0') && (*name != '#'))
if ((resource == (char *) NULL) || (LocaleCompare(name,resource) != 0))
{
Expand Down

0 comments on commit dd84447

Please sign in to comment.