Possible NULL pointer reference found by Coverity checks.
Steve Peters [Sat, 11 Mar 2006 21:41:20 +0000 (21:41 +0000)]
p4raw-id: //depot/perl@27476

op.c

diff --git a/op.c b/op.c
index 9f91361..51f962a 100644 (file)
--- a/op.c
+++ b/op.c
@@ -4237,10 +4237,10 @@ Perl_newLOOPOP(pTHX_ I32 flags, I32 debuggable, OP *expr, OP *block)
                break;
 
              case OP_SASSIGN:
-               if (k1->op_type == OP_READDIR
+               if (k1 && (k1->op_type == OP_READDIR
                      || k1->op_type == OP_GLOB
                      || (k1->op_type == OP_NULL && k1->op_targ == OP_GLOB)
-                     || k1->op_type == OP_EACH)
+                     || k1->op_type == OP_EACH))
                    expr = newUNOP(OP_DEFINED, 0, expr);
                break;
            }