summaryrefslogtreecommitdiffstats
path: root/contrib/perl5/lib/tainted.pl
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/perl5/lib/tainted.pl')
-rw-r--r--contrib/perl5/lib/tainted.pl9
1 files changed, 9 insertions, 0 deletions
diff --git a/contrib/perl5/lib/tainted.pl b/contrib/perl5/lib/tainted.pl
new file mode 100644
index 0000000..6e24867
--- /dev/null
+++ b/contrib/perl5/lib/tainted.pl
@@ -0,0 +1,9 @@
+# This subroutine returns true if its argument is tainted, false otherwise.
+
+sub tainted {
+ local($@);
+ eval { kill 0 * $_[0] };
+ $@ =~ /^Insecure/;
+}
+
+1;
OpenPOWER on IntegriCloud