| 1 | # -*- mode: perl; coding: utf-8 -*- | ||||||||||||||||||||||||||||
| 2 | package YATT::Util::Taint; | ||||||||||||||||||||||||||||
| 3 | 13 | ▶ | use base qw(Exporter); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 13 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 13 | ▶ | use warnings qw(FATAL all NONFATAL misc); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 13 | ▶ | BEGIN { | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 13 | our @EXPORT_OK = qw(&untaint_any &is_tainted); | |||||||||||||||||||||||||||
| 9 | 13 | our @EXPORT = @EXPORT_OK; | |||||||||||||||||||||||||||
| 10 | } | ||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 13 | ▶ | if (eval {require Scalar::Util} and not $@) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
eval {
do {
require Scalar::Util
}
} and not $@
MC/DC0%0/2
eval {
do {
require Scalar::Util
}
} and not $@
eval {
do {
require Scalar::Util
}
}
not $@
Truth table33%1/3
A and not(B)
A= eval {
do {
require Scalar::Util
}
}B= not $@
| |||||||||||||||||||||||||||||
| 13 | 13 | *is_tainted = \&Scalar::Util::tainted; | |||||||||||||||||||||||||||
| 14 | } else { | ||||||||||||||||||||||||||||
| 15 | 0 | ▶ | *is_tainted = sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 16 | 0 | return not eval { eval("#" . substr(join("", @_), 0, 0)); 1 }; | |||||||||||||||||||||||||||
| 17 | 0 | }; | |||||||||||||||||||||||||||
| 18 | } | ||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 558 | ▶ | sub untaint_any ($) { | ||||||||||||||||||||||||||
|
Subroutine
untaint_any: called CC=3 SCAR=14.2
Pod
undocumented
| |||||||||||||||||||||||||||||
| 21 | 558 | ▶ | $1 if defined $_[0] && $_[0] =~ m{(.*)}s; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $_[0] and $_[0] =~ /(.*)/s
MC/DC0%0/2
defined $_[0] and $_[0] =~ /(.*)/s
defined $_[0]
$_[0] =~ /(.*)/s
Truth table33%1/3
A and B
A= defined $_[0]B= $_[0] =~ /(.*)/s
| |||||||||||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | 13 | 1; | |||||||||||||||||||||||||||