GraphicsMagick: MogrifyImage(): Assure that -set has arguments

GraphicsMagick Commits <[email protected]>
Newsgroups gmane.comp.video.graphicsmagick.cvs
Message-ID <mailman.3301.1685824157.1565.graphicsmagick-commit@lists.sourceforge.net>
changeset 3cedf794348b in /hg/GraphicsMagick
details: http://hg.GraphicsMagick.org/hg/GraphicsMagick?cmd=changeset;node=3cedf794348b
summary: MogrifyImage(): Assure that -set has arguments

diffstat:

 ChangeLog          |   4 ++++
 magick/command.c   |  10 ++++++++++
 www/Changelog.html |   3 +++
 3 files changed, 17 insertions(+), 0 deletions(-)

diffs (50 lines):

diff -r bb068ff50d5c -r 3cedf794348b ChangeLog
--- a/ChangeLog	Sat Jun 03 14:04:58 2023 -0500
+++ b/ChangeLog	Sat Jun 03 15:29:02 2023 -0500
@@ -1,5 +1,9 @@
 2023-06-03  Bob Friesenhahn  <[email protected]>
 
+	* magick/command.c (MogrifyImage): Assure that -set has arguments.
+	Addresses SourceForge issue #701 "Segmentation Violation in gm
+	(magick/attribute.c:324 in SetImageAttribute)".
+
 	* magick/analyze.c (AllocateDepthMap): Use resource-limited memory
 	allocator.
 
diff -r bb068ff50d5c -r 3cedf794348b magick/command.c
--- a/magick/command.c	Sat Jun 03 14:04:58 2023 -0500
+++ b/magick/command.c	Sat Jun 03 15:29:02 2023 -0500
@@ -11014,10 +11014,20 @@
               *key,
               *value;
 
+            if (i+1 > argc)
+              {
+                ThrowException(&(*image)->exception,OptionError,MissingArgument,option+1);
+                break;
+              }
             key=argv[++i];
             (void) SetImageAttribute(*image,key,(char *) NULL);
             if (*option == '-')
               {
+                if (i+1 > argc)
+                  {
+                    ThrowException(&(*image)->exception,OptionError,MissingArgument,option+1);
+                    break;
+                  }
                 value=argv[++i];
                 (void) SetImageAttribute(*image,key,value);
               }
diff -r bb068ff50d5c -r 3cedf794348b www/Changelog.html
--- a/www/Changelog.html	Sat Jun 03 14:04:58 2023 -0500
+++ b/www/Changelog.html	Sat Jun 03 15:29:02 2023 -0500
@@ -40,6 +40,9 @@
 <p>2023-06-03  Bob Friesenhahn  &lt;<a class="reference external" href="mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>
 <blockquote>
 <ul class="simple">
+<li><p>magick/command.c (MogrifyImage): Assure that -set has arguments.
+Addresses SourceForge issue #701 &quot;Segmentation Violation in gm
+(magick/attribute.c:324 in SetImageAttribute)&quot;.</p></li>
 <li><p>magick/analyze.c (AllocateDepthMap): Use resource-limited memory
 allocator.</p></li>
 <li><p>magick/operator.c (QuantumDepthCB): Janitorial cleanups.</p></li>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.