Permalink
Browse files

Prevent buffer overflow (bug report from Ibrahim el-sayed)

  • Loading branch information...
Cristy
Cristy committed Jul 25, 2016
1 parent ae87d4d commit dd84447b63a71fa8c3f47071b09454efc667767b
Showing with 5 additions and 0 deletions.
  1. +5 −0 MagickCore/property.c
@@ -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))
{

0 comments on commit dd84447

Please sign in to comment.