GraphicsMagick: MogrifyImage(): Improve 'operator' parameter val...
GraphicsMagick Commits <[email protected]>
| Newsgroups | gmane.comp.video.graphicsmagick.cvs |
|---|---|
| Message-ID | <mailman.2055.1678650391.1748.graphicsmagick-commit@lists.sourceforge.net> |
changeset aa44650e43ff in /hg/GraphicsMagick
details: http://hg.GraphicsMagick.org/hg/GraphicsMagick?cmd=changeset;node=aa44650e43ff
summary: MogrifyImage(): Improve 'operator' parameter validation
diffstat:
ChangeLog | 3 +++
magick/command.c | 2 +-
magick/utility.c | 2 +-
www/Changelog.html | 5 ++++-
4 files changed, 9 insertions(+), 3 deletions(-)
diffs (52 lines):
diff -r ff543ff189de -r aa44650e43ff ChangeLog
--- a/ChangeLog Sun Mar 12 14:21:17 2023 -0500
+++ b/ChangeLog Sun Mar 12 14:46:21 2023 -0500
@@ -3,6 +3,9 @@
* magick/command.c (ConjureImageCommand): Properly check argument
list when handling options. Addresses SourceForge issue #693
"Segmentation Violation in gm - SetImageAttribute function".
+ (MogrifyImage): Improve operator parameter validation. Addresses
+ SourceForge issue #694 "Segmentation Violation in gm (MagickStrToD
+ function)".
* magick/error.c (DefaultFatalErrorHandler): Perform printf
substitutions similar to DefaultErrorHandler.
diff -r ff543ff189de -r aa44650e43ff magick/command.c
--- a/magick/command.c Sun Mar 12 14:21:17 2023 -0500
+++ b/magick/command.c Sun Mar 12 14:46:21 2023 -0500
@@ -10408,7 +10408,7 @@
double
rvalue;
- if ((argv[i+1] == NULL) || (argv[i+2] == NULL) || (argv[i+3] == NULL))
+ if (i+3 > argc)
{
ThrowException(&(*image)->exception,OptionError,MissingArgument,option+1);
break;
diff -r ff543ff189de -r aa44650e43ff magick/utility.c
--- a/magick/utility.c Sun Mar 12 14:21:17 2023 -0500
+++ b/magick/utility.c Sun Mar 12 14:46:21 2023 -0500
@@ -930,7 +930,7 @@
*/
assert(argc != (int *) NULL);
assert(argv != (char ***) NULL);
- vector=MagickAllocateMemory(char **,(*argc+prealloc_entries)*sizeof(char *));
+ vector=MagickAllocateClearedMemory(char **,(*argc+prealloc_entries)*sizeof(char *));
if (vector == (char **) NULL)
return(MagickFail);
/*
diff -r ff543ff189de -r aa44650e43ff www/Changelog.html
--- a/www/Changelog.html Sun Mar 12 14:21:17 2023 -0500
+++ b/www/Changelog.html Sun Mar 12 14:46:21 2023 -0500
@@ -42,7 +42,10 @@
<ul class="simple">
<li><p>magick/command.c (ConjureImageCommand): Properly check argument
list when handling options. Addresses SourceForge issue #693
-"Segmentation Violation in gm - SetImageAttribute function".</p></li>
+"Segmentation Violation in gm - SetImageAttribute function".
+(MogrifyImage): Improve operator parameter validation. Addresses
+SourceForge issue #694 "Segmentation Violation in gm (MagickStrToD
+function)".</p></li>
<li><p>magick/error.c (DefaultFatalErrorHandler): Perform printf
substitutions similar to DefaultErrorHandler.</p></li>
<li><p>magick/error.h: Add parameter names to prototypes.</p></li>