summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorRadu Greab <radu@netsoft.ro>2000-10-03 01:03:44 +0300
committerJarkko Hietaniemi <jhi@iki.fi>2000-10-02 23:35:40 +0000
commit35fba0d9b63c24c469494ae4d5dc6f37fed89345 (patch)
tree4a3a2033c50e7c9a1eeb6732682fe21898afa3d6 /op.c
parent01bb7c6d67bc951562ed98068eba189cadd42374 (diff)
downloadperl-35fba0d9b63c24c469494ae4d5dc6f37fed89345.tar.gz
Re: [ID 20000912.008] substr replacement of tainted data (bug)
Message-ID: <14808.56336.594486.626712@busy.netsoft.ro> p4raw-id: //depot/perl@7111
Diffstat (limited to 'op.c')
-rw-r--r--op.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/op.c b/op.c
index 4856d98b6d..84a1df9adb 100644
--- a/op.c
+++ b/op.c
@@ -6463,6 +6463,22 @@ Perl_ck_trunc(pTHX_ OP *o)
return ck_fun(o);
}
+OP *
+Perl_ck_substr(pTHX_ OP *o)
+{
+ o = ck_fun(o);
+ if ((o->op_flags & OPf_KIDS) && o->op_private == 4) {
+ OP *kid = cLISTOPo->op_first;
+
+ if (kid->op_type == OP_NULL)
+ kid = kid->op_sibling;
+ if (kid)
+ kid->op_flags |= OPf_MOD;
+
+ }
+ return o;
+}
+
/* A peephole optimizer. We visit the ops in the order they're to execute. */
void