summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-08 08:19:32 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-08 08:19:32 +0000
commit311960cdaf4e884643235fe83a3970b5e1f5ba47 (patch)
tree0575c47a703cb5a6a1df40b6a1626bbeacdc249f /ext
parent418b8e121c1e8312cdead70e5acb2d14e1a40639 (diff)
win32ole.c: check arity
* ext/win32ole/win32ole.c (fole_missing): should check actual argument count before accessing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/win32ole/win32ole.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c
index 5310cbfae1..37fa1c63c8 100644
--- a/ext/win32ole/win32ole.c
+++ b/ext/win32ole/win32ole.c
@@ -4078,6 +4078,7 @@ fole_missing(int argc, VALUE *argv, VALUE self)
ID id;
const char* mname;
int n;
+ rb_check_arity(argc, 1, UNLIMITED_ARGUMENTS);
id = rb_to_id(argv[0]);
mname = rb_id2name(id);
if(!mname) {
@@ -4085,6 +4086,7 @@ fole_missing(int argc, VALUE *argv, VALUE self)
}
n = strlen(mname);
if(mname[n-1] == '=') {
+ rb_check_arity(argc, 2, 2);
argv[0] = rb_enc_str_new(mname, n-1, cWIN32OLE_enc);
return ole_propertyput(self, argv[0], argv[1]);