Try not to use negative values when accessing arrays in C. Yet another
authorSteve Peters <steve@fisharerojo.org>
Wed, 5 Apr 2006 16:15:41 +0000 (16:15 +0000)
committerSteve Peters <steve@fisharerojo.org>
Wed, 5 Apr 2006 16:15:41 +0000 (16:15 +0000)
Coverity catch.

p4raw-id: //depot/perl@27724

util.c

diff --git a/util.c b/util.c
index 9239070..b4ed7f2 100644 (file)
--- 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)