From: Steve Peters <steve@fisharerojo.org>
Date: Wed, 5 Apr 2006 16:15:41 +0000 (+0000)
Subject: Try not to use negative values when accessing arrays in C.  Yet another
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2c1c1caaefc9a6157e7d86987f121276e2115620;p=p5sagit%2Fp5-mst-13.2.git

Try not to use negative values when accessing arrays in C.  Yet another
Coverity catch.

p4raw-id: //depot/perl@27724
---

diff --git a/util.c b/util.c
index 9239070..b4ed7f2 100644
--- a/util.c
+++ b/util.c
@@ -3419,6 +3419,7 @@ Perl_report_evil_fh(pTHX_ const GV *gv, const IO *io, I32 op)
     const char * const func =
 	op == OP_READLINE   ? "readline"  :	/* "<HANDLE>" not nice */
 	op == OP_LEAVEWRITE ? "write" :		/* "write exit" not nice */
+	op < 0              ? "" :              /* handle phoney cases */
 	PL_op_desc[op];
     const char * const pars = OP_IS_FILETEST(op) ? "" : "()";
     const char * const type = OP_IS_SOCKET(op)