[前][次][番号順一覧][スレッド一覧]

ruby-changes:37234

From: suke <ko1@a...>
Date: Sun, 18 Jan 2015 11:53:32 +0900 (JST)
Subject: [ruby-changes:37234] suke:r49315 (trunk): * ext/win32ole/win32ole.c (ole_invoke): avoid SEGV when VT_RECORD

suke	2015-01-18 11:53:18 +0900 (Sun, 18 Jan 2015)

  New Revision: 49315

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49315

  Log:
    * ext/win32ole/win32ole.c (ole_invoke): avoid SEGV when VT_RECORD
      variable is passed by reference. [ruby-dev:48803] [Bug #10697]

  Modified files:
    trunk/ChangeLog
    trunk/ext/win32ole/win32ole.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 49314)
+++ ChangeLog	(revision 49315)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Jan 18 11:49:46 2015  Masaki Suketa <masaki.suketa@n...>
+
+	* 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@r...>
 
 	* ext/psych/lib/psych/visitors/yaml_tree.rb (visit_String):
Index: ext/win32ole/win32ole.c
===================================================================
--- ext/win32ole/win32ole.c	(revision 49314)
+++ ext/win32ole/win32ole.c	(revision 49315)
@@ -2663,6 +2663,10 @@ ole_invoke(int argc, VALUE *argv, VALUE https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L2663
             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;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]