summaryrefslogtreecommitdiff
path: root/ext/dl/dl.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-11 11:33:44 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-11 11:33:44 +0000
commit199a95775b4f0e8d7ecab2946b8d7c250a695f40 (patch)
tree623e6cac5cbf684b9066f66b4c5aae7375439f86 /ext/dl/dl.c
parent35b6abbca2cb419aae599d04e5855e33a97935dd (diff)
* ext/dl/cfunc.c (rb_dlcfunc_call): add taint check.
* ext/dl/dl.c (rb_dl_malloc): add rb_secure(2). * ext/dl/dl.c (rb_dl_realloc): ditto. * ext/dl/dl.c (rb_dl_free): ditto. * ext/dl/dl.c (rb_dl_ptr2value): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dl/dl.c')
-rw-r--r--ext/dl/dl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/dl/dl.c b/ext/dl/dl.c
index e4bd4d41e92..0427dfb3f3f 100644
--- a/ext/dl/dl.c
+++ b/ext/dl/dl.c
@@ -22,6 +22,7 @@ rb_dl_malloc(VALUE self, VALUE size)
{
void *ptr;
+ rb_secure(4);
ptr = (void*)ruby_xmalloc(NUM2INT(size));
return PTR2NUM(ptr);
}
@@ -31,6 +32,7 @@ rb_dl_realloc(VALUE self, VALUE addr, VALUE size)
{
void *ptr = NUM2PTR(addr);
+ rb_secure(4);
ptr = (void*)ruby_xrealloc(ptr, NUM2INT(size));
return PTR2NUM(ptr);
}
@@ -39,6 +41,8 @@ VALUE
rb_dl_free(VALUE self, VALUE addr)
{
void *ptr = NUM2PTR(addr);
+
+ rb_secure(4);
ruby_xfree(ptr);
return Qnil;
}
@@ -46,6 +50,7 @@ rb_dl_free(VALUE self, VALUE addr)
VALUE
rb_dl_ptr2value(VALUE self, VALUE addr)
{
+ rb_secure(4);
return (VALUE)NUM2PTR(addr);
}