Prevent possible buffer overrun

This commit is contained in:
Cristy
2020-02-23 08:22:32 -05:00
parent bfbf549266
commit 1abaabbbf9
3 changed files with 15 additions and 3 deletions
+5 -1
View File
@@ -1217,7 +1217,11 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc,
}
for (p=start_color; (*p != '-') && (*p != '\0'); p++)
if (*p == '(')
for (p++; (*p != ')') && (*p != '\0'); p++);
{
for (p++; (*p != ')') && (*p != '\0'); p++);
if (*p == '\0')
break;
}
if (*p == '-')
(void) CopyMagickString(stop_color,p+1,MagickPathExtent);
*p='\0';
+5 -1
View File
@@ -2088,7 +2088,11 @@ static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand,
}
for (p=start_color; (*p != '-') && (*p != '\0'); p++)
if (*p == '(')
for (p++; (*p != ')') && (*p != '\0'); p++);
{
for (p++; (*p != ')') && (*p != '\0'); p++);
if (*p == '\0')
break;
}
if (*p == '-')
(void) CopyMagickString(stop_color,p+1,MagickPathExtent);
*p='\0';
+5 -1
View File
@@ -203,7 +203,11 @@ static Image *ReadGRADIENTImage(const ImageInfo *image_info,
MagickPathExtent);
for (p=start_color; (*p != '-') && (*p != '\0'); p++)
if (*p == '(')
for (p++; (*p != ')') && (*p != '\0'); p++);
{
for (p++; (*p != ')') && (*p != '\0'); p++);
if (*p == '\0')
break;
}
if (*p == '-')
(void) CopyMagickString(stop_color,p+1,MagickPathExtent);
*p='\0';