summaryrefslogtreecommitdiff
path: root/ext/dl/lib/dl/func.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/dl/lib/dl/func.rb')
-rw-r--r--ext/dl/lib/dl/func.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/dl/lib/dl/func.rb b/ext/dl/lib/dl/func.rb
index a2e5038..543711f 100644
--- a/ext/dl/lib/dl/func.rb
+++ b/ext/dl/lib/dl/func.rb
@@ -92,6 +92,9 @@ module DL
super
else
funcs = []
+ if $SAFE >= 1 && args.any? { |x| x.tainted? }
+ raise SecurityError, "tainted parameter not allowed"
+ end
_args = wrap_args(args, @stack.types, funcs, &block)
r = @cfunc.call(@stack.pack(_args))
funcs.each{|f| f.unbind_at_call()}