Coverity 1232, Potential out-of-bounds read.

Alex Cherepanov <[email protected]> Thu, 25 Dec 2008 13:42:40 -0500
Newsgroups gmane.comp.printing.ghostscript.patches
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--------------080706000403030909050409
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Fix a potential out-of-bounds read access in cvs and similar operators.
Regression testing shows no differences.




--------------080706000403030909050409
Content-Type: text/plain;
 name="cov1232.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="cov1232.diff"

Index: gs/psi/iutil.c
===================================================================
--- gs/psi/iutil.c	(revision 9301)
+++ gs/psi/iutil.c	(working copy)
@@ -477,7 +477,7 @@
 	    {
 		int rtype = r_btype(op);
 
-		if (rtype > countof(type_strings))
+		if (rtype >= countof(type_strings))
 		    return_error(e_rangecheck);
 		data = (const byte *)type_strings[rtype];
 		if (data == 0)



--------------080706000403030909050409
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
gs-code-review mailing list
[email protected]
http://www.ghostscript.com/mailman/listinfo/gs-code-review

--------------080706000403030909050409--