Re: Coverity 1232, Potential out-of-bounds read.

"Igor V. Melichev" <[email protected]> Thu, 25 Dec 2008 22:52:56 +0300
Newsgroups gmane.comp.printing.ghostscript.patches
Message-ID <[email protected]>
Fine with me.

----- Original Message ----- 
From: "Alex Cherepanov" <[email protected]>
To: <[email protected]>
Sent: Thursday, December 25, 2008 9:42 PM
Subject: [gs-code-review] Coverity 1232, Potential out-of-bounds read.


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


--------------------------------------------------------------------------------


> 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)
>
>
>


--------------------------------------------------------------------------------


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