summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-18 02:53:18 +0000
committersuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-18 02:53:18 +0000
commit8f67e9807a9cf252c9330c7273820cd99db36b13 (patch)
tree0e5c29ecb679b1c6ccdd6c0660470def50ab0fbb
parent8287581afce60aa9b6f4a9ea123594c8a2cebb53 (diff)
* ext/win32ole/win32ole.c (ole_invoke): avoid SEGV when VT_RECORD
variable is passed by reference. [ruby-dev:48803] [Bug #10697] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--ext/win32ole/win32ole.c4
2 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 97eed21..1b29842 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sun Jan 18 11:49:46 2015 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c (ole_invoke): avoid SEGV when VT_RECORD
+ variable is passed by reference. [ruby-dev:48803] [Bug #10697]
+
Sat Jan 17 23:59:15 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/psych/lib/psych/visitors/yaml_tree.rb (visit_String):
diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c
index 582ff32..c60564d 100644
--- a/ext/win32ole/win32ole.c
+++ b/ext/win32ole/win32ole.c
@@ -2663,6 +2663,10 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket)
param = rb_ary_entry(paramS, i-cNamedArgs);
if (rb_obj_is_kind_of(param, cWIN32OLE_VARIANT)) {
ole_variant2variant(param, &op.dp.rgvarg[n]);
+ } else if (rb_obj_is_kind_of(param, cWIN32OLE_RECORD)) {
+ ole_val2variant(param, &realargs[n]);
+ op.dp.rgvarg[n] = realargs[n];
+ V_VT(&op.dp.rgvarg[n]) = VT_RECORD | VT_BYREF;
} else {
ole_val2variant(param, &realargs[n]);
V_VT(&op.dp.rgvarg[n]) = VT_VARIANT | VT_BYREF;