This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
use locale; fc(""); shouldn't taint.
authorBrian Fraser <fraserbn@gmail.com>
Mon, 30 Jan 2012 19:30:24 +0000 (16:30 -0300)
committerKarl Williamson <public@khwilliamson.com>
Tue, 31 Jan 2012 02:28:10 +0000 (19:28 -0700)
fc() brought to life its own version of #39028. fc(""), like
lc("") and friends, shouldn't taint the result.

pp.c

diff --git a/pp.c b/pp.c
index 29ed4c6..f6ad80f 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -4184,7 +4184,7 @@ PP(pp_fc)
            SvTAINTED_on(dest);
        }
     } /* Unflagged string */
-    else {
+    else if (len) {
         /* For locale, bytes, and nothing, the behavior is supposed to be the
          * same as lc().
          */