From 2690939122bdf4af84ebd0207272442b8ce34ef3 Mon Sep 17 00:00:00 2001 From: ttate Date: Tue, 11 Jun 2002 14:54:51 +0000 Subject: Check the length of proto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/dl/mkcallback.rb | 2 ++ 1 file changed, 2 insertions(+) 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);", "", -- cgit v1.2.3