JNG: Fix wrong offset into oFFs chunk which caused heap read overflow.

Sat, 16 Dec 2017 13:08:45 -0600

author
Bob Friesenhahn <bfriesen@GraphicsMagick.org>
date
Sat, 16 Dec 2017 13:08:45 -0600
changeset 15304
8e3d2264109c
parent 15303
60932931559a
child 15305
1be7d727412f

JNG: Fix wrong offset into oFFs chunk which caused heap read overflow.

ChangeLog file | annotate | diff | comparison | revisions
coders/png.c file | annotate | diff | comparison | revisions
www/Changelog.html file | annotate | diff | comparison | revisions
--- a/ChangeLog	Sat Dec 16 10:08:39 2017 -0600
+++ b/ChangeLog	Sat Dec 16 13:08:45 2017 -0600
@@ -1,5 +1,10 @@
 2017-12-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>
 
+	* coders/png.c (ReadOneJNGImage): Fix SourceForge issue #530
+	"heap-buffer-overflow in ReadOneJNGImage".  In this case there is
+	a read one byte beyond the oFFs chunk allocation size due to an
+	error in specifying an offset into the chunk.
+
 	* coders/palm.c (ReadPALMImage): Fix SourceForge issue #529
 	"global-buffer-overflow in ReadPALMImage".  This issue only
 	occured in builds with QuantumDepth=8 due to the small range of
--- a/coders/png.c	Sat Dec 16 10:08:39 2017 -0600
+++ b/coders/png.c	Sat Dec 16 13:08:45 2017 -0600
@@ -3523,7 +3523,7 @@
             {
               image->page.x=mng_get_long(p);
               image->page.y=mng_get_long(&p[4]);
-              if ((int) p[9] != 0)
+              if ((int) p[8] != 0)
                 {
                   image->page.x/=10000;
                   image->page.y/=10000;
--- a/www/Changelog.html	Sat Dec 16 10:08:39 2017 -0600
+++ b/www/Changelog.html	Sat Dec 16 13:08:45 2017 -0600
@@ -38,6 +38,10 @@
 <p>2017-12-16  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>coders/png.c (ReadOneJNGImage): Fix SourceForge issue #530
+&quot;heap-buffer-overflow in ReadOneJNGImage&quot;.  In this case there is
+a read one byte beyond the oFFs chunk allocation size due to an
+error in specifying an offset into the chunk.</li>
 <li>coders/palm.c (ReadPALMImage): Fix SourceForge issue #529
 &quot;global-buffer-overflow in ReadPALMImage&quot;.  This issue only
 occured in builds with QuantumDepth=8 due to the small range of

mercurial