Added blind untainter. Use with extreme care.
This commit is contained in:
parent
2c6fef0742
commit
173b029301
17
Utils.pm
17
Utils.pm
@ -45,7 +45,7 @@ use strict;
|
||||
|
||||
our @ISA = qw(Exporter);
|
||||
our @EXPORT = qw();
|
||||
our @EXPORT_OK = qw(path_join superchomp is_defined_numeric rfc822_date title_case sentence_case get_proc_size);
|
||||
our @EXPORT_OK = qw(path_join superchomp is_defined_numeric rfc822_date title_case sentence_case get_proc_size blind_untaint);
|
||||
|
||||
our $VERSION = 1.0;
|
||||
|
||||
@ -198,4 +198,19 @@ sub get_proc_size {
|
||||
return $vsize || -1;
|
||||
}
|
||||
|
||||
|
||||
## @fn $ blind_untaint($str)
|
||||
# Untaint the specified string blindly. This should generally only be used in
|
||||
# situations where the string is guaranteed to be safe, it just needs to be
|
||||
# untainted.
|
||||
#
|
||||
# @param str The string to untaint
|
||||
# @return The untainted string
|
||||
sub blind_untaint {
|
||||
my $str = shift;
|
||||
|
||||
my ($untainted) = $str =~ /^(.*)$/;
|
||||
return $untainted;
|
||||
}
|
||||
|
||||
1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user