mirror of
https://github.com/ImageMagick/ImageMagick.git
synced 2026-05-31 11:18:42 +02:00
Prevent possible buffer overrun
This commit is contained in:
@@ -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';
|
||||
|
||||
@@ -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
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user