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 | 70a8fb98b02a19401a4869444471773bc1958948 (patch) | |
tree | b371fa78f0a5d52d92753b1c431a375922b99a35 /ext | |
parent | 8741d5e339032ea8794d5fc78d6061645b67c388 (diff) | |
download | ruby-70a8fb98b02a19401a4869444471773bc1958948.tar.gz ruby-70a8fb98b02a19401a4869444471773bc1958948.tar.xz ruby-70a8fb98b02a19401a4869444471773bc1958948.zip |
Check the length of proto.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-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 9a1218473..1004454fc 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);", "", |