SV *targ = cx->sb_targ;
sv_catpvn(dstr, s, cx->sb_strend - s);
+ TAINT_IF(cx->sb_rxtainted || rx->exec_tainted);
+
(void)SvOOK_off(targ);
Safefree(SvPVX(targ));
SvPVX(targ) = SvPVX(dstr);
(void)SvPOK_only(targ);
SvSETMAGIC(targ);
- if (cx->sb_rxtainted)
- SvTAINTED_on(targ);
+ SvTAINT(targ);
PUSHs(sv_2mortal(newSViv((I32)cx->sb_iters - 1)));
LEAVE_SCOPE(cx->sb_oldsave);
POPSUBST(cx);
strend = s + len;
if (!s)
DIE("panic: do_match");
+ TAINT_NOT;
if (pm->op_pmflags & PMf_USED) {
if (gimme == G_ARRAY)
/*NOTREACHED*/
gotcha:
+ TAINT_IF(rx->exec_tainted);
if (gimme == G_ARRAY) {
I32 iters, i, len;
- TAINT_IF(rx->exec_tainted);
iters = rx->nparens;
if (global && !iters)
i = 1;
}
yup:
+ TAINT_IF(rx->exec_tainted);
++BmUSEFUL(pm->op_pmshort);
curpm = pm;
if (pm->op_pmflags & PMf_ONCE)
++BmUSEFUL(pm->op_pmshort);
ret_no:
+ TAINT_IF(rx->exec_tainted); /* /\W/ */
LEAVE_SCOPE(oldsave);
if (gimme == G_ARRAY)
RETURN;
s = SvPV(TARG, len);
if (!SvPOKp(TARG) || SvREADONLY(TARG) || (SvTYPE(TARG) == SVt_PVGV))
force_on_match = 1;
+ TAINT_NOT;
force_it:
if (!pm || !s)
if (c && clen <= rx->minlen) {
if (! pregexec(rx, s, strend, orig, 0,
SvSCREAM(TARG) ? TARG : Nullsv, safebase)) {
+ TAINT_IF(rx->exec_tainted);
PUSHs(&sv_no);
LEAVE_SCOPE(oldsave);
RETURN;
else {
sv_chop(TARG, d);
}
+ TAINT_IF(rxtainted);
PUSHs(&sv_yes);
}
else {
SvCUR_set(TARG, d - SvPVX(TARG) + i);
Move(s, d, i+1, char); /* include the NUL */
}
+ TAINT_IF(rxtainted);
PUSHs(sv_2mortal(newSViv((I32)iters)));
}
(void)SvPOK_only(TARG);
SvSETMAGIC(TARG);
- if (rxtainted)
- SvTAINTED_on(TARG);
+ SvTAINT(TARG);
LEAVE_SCOPE(oldsave);
RETURN;
}
} while (pregexec(rx, s, strend, orig, s == m, Nullsv, safebase));
sv_catpvn(dstr, s, strend - s);
+ TAINT_IF(rxtainted);
+
(void)SvOOK_off(TARG);
Safefree(SvPVX(TARG));
SvPVX(TARG) = SvPVX(dstr);
(void)SvPOK_only(TARG);
SvSETMAGIC(TARG);
- if (rxtainted)
- SvTAINTED_on(TARG);
+ SvTAINT(TARG);
PUSHs(sv_2mortal(newSViv((I32)iters)));
LEAVE_SCOPE(oldsave);
RETURN;
}
+
+ TAINT_IF(rx->exec_tainted);
PUSHs(&sv_no);
LEAVE_SCOPE(oldsave);
RETURN;