This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #79680] overload 1.10 sprintf fails taint checking
authorMichael Fig <michael@liveblockauctions.com>
Sat, 27 Nov 2010 13:44:26 +0000 (05:44 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Sat, 27 Nov 2010 15:41:47 +0000 (07:41 -0800)
[Note from the committer: I cannot reproduce the bug this is intended
to fix. I suspect the author has a botched Scalar::Util installation.
But it *does* make the code go faster, as it uses fewer ops. That’s my
reason for appling it.]

lib/overload.pm

index 31c88b7..dbc3de6 100644 (file)
@@ -99,7 +99,7 @@ sub AddrRef {
   my $class_prefix = defined($class) ? "$class=" : "";
   my $type = Scalar::Util::reftype($_[0]);
   my $addr = Scalar::Util::refaddr($_[0]);
-  return sprintf("$class_prefix$type(0x%x)", $addr);
+  return sprintf("%s%s(0x%x)", $class_prefix, $type, $addr);
 }
 
 *StrVal = *AddrRef;