summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-03-31 06:28:49 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-03-31 06:28:49 -0700
commit539689e74a3bcb04d29e4cd9396de91a81045b99 (patch)
tree06bda337e524215a894848863bc99947114a7a26 /pp.c
parent968ee499ff66c6dcd466884030cb185844f2d94f (diff)
downloadperl-539689e74a3bcb04d29e4cd9396de91a81045b99.tar.gz
[perl #87336] lc/uc(first) fail to taint the returned string
This bug was caused by change 28011 (ec9af7d), which stopped pp_lc from using sv_setsv_flags, thereby bypassing these two lines at the end of that function: if (SvTAINTED(sstr)) SvTAINT(dstr); Change 28012 (6730619) did exactly the same thing to pp_uc. 28013 (d54190f) broke ucfirst and lcfirst. This commit simply puts that taint logic at the end of the pp_* functions.
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/pp.c b/pp.c
index 751a0bf79e..8b15b6ec5f 100644
--- a/pp.c
+++ b/pp.c
@@ -4209,6 +4209,8 @@ PP(pp_ucfirst)
SvCUR_set(dest, need - 1);
}
}
+ if (dest != source && SvTAINTED(source))
+ SvTAINT(dest);
SvSETMAGIC(dest);
RETURN;
}
@@ -4479,6 +4481,8 @@ PP(pp_uc)
SvCUR_set(dest, d - (U8*)SvPVX_const(dest));
}
} /* End of isn't utf8 */
+ if (dest != source && SvTAINTED(source))
+ SvTAINT(dest);
SvSETMAGIC(dest);
RETURN;
}
@@ -4701,6 +4705,8 @@ PP(pp_lc)
SvCUR_set(dest, d - (U8*)SvPVX_const(dest));
}
}
+ if (dest != source && SvTAINTED(source))
+ SvTAINT(dest);
SvSETMAGIC(dest);
RETURN;
}