diff options
author | ttate <ttate@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-06-11 14:54:51 +0000 |
---|---|---|
committer | ttate <ttate@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-06-11 14:54:51 +0000 |
commit | 2690939122bdf4af84ebd0207272442b8ce34ef3 (patch) | |
tree | b371fa78f0a5d52d92753b1c431a375922b99a35 /ext/dl | |
parent | 5434d73ef7fada1c75499f18a7b7b0ca5c79a39b (diff) |
Check the length of proto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dl')
-rw-r--r-- | ext/dl/mkcallback.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/dl/mkcallback.rb b/ext/dl/mkcallback.rb index 9a12184734..1004454fcd 100644 --- a/ext/dl/mkcallback.rb +++ b/ext/dl/mkcallback.rb @@ -34,6 +34,8 @@ def mkfunc(rettype, fnum, argc) " proto = rb_ary_entry(obj, 0);", " proc = rb_ary_entry(obj, 1);", " Check_Type(proto, T_STRING);", + " if( RSTRING(proto)->len >= #{argc.to_s} )", + " rb_raise(rb_eArgError, \"too many arguments\");", " rb_dl_scan_callback_args(buff, RSTRING(proto)->ptr, &argc, argv);", " retval = rb_funcall2(proc, id_call, argc, argv);", "", |