ruby-changes:35071
From: suke <ko1@a...>
Date: Tue, 12 Aug 2014 21:51:51 +0900 (JST)
Subject: [ruby-changes:35071] suke:r47153 (trunk): * ext/win32ole/win32ole.c (ole_create_dcom): use the converted
suke 2014-08-12 21:51:36 +0900 (Tue, 12 Aug 2014) New Revision: 47153 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=47153 Log: * ext/win32ole/win32ole.c (ole_create_dcom): use the converted result if the argument can be converted to a string, to get rid of invalid access. Thanks to nobu. [ruby-dev:48467] [Bug #10127] Modified files: trunk/ChangeLog trunk/ext/win32ole/win32ole.c Index: ChangeLog =================================================================== --- ChangeLog (revision 47152) +++ ChangeLog (revision 47153) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Tue Aug 12 21:49:40 2014 Masaki Suketa <masaki.suketa@n...> + + * ext/win32ole/win32ole.c (ole_create_dcom): use the converted + result if the argument can be converted to a string, to get rid + of invalid access. Thanks to nobu. [ruby-dev:48467] [Bug #10127] + Tue Aug 12 14:22:58 2014 SHIBATA Hiroshi <shibata.hiroshi@g...> * configure.in: ignored working directory same as prefix value. Index: ext/win32ole/win32ole.c =================================================================== --- ext/win32ole/win32ole.c (revision 47152) +++ ext/win32ole/win32ole.c (revision 47153) @@ -45,7 +45,7 @@ const IID IID_IMultiLanguage2 = {0xDCCFC https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L45 #define NUM2UI8 NUM2UINT #endif -#define WIN32OLE_VERSION "1.7.6" +#define WIN32OLE_VERSION "1.7.7" typedef HRESULT (STDAPICALLTYPE FNCOCREATEINSTANCEEX) (REFCLSID, IUnknown*, DWORD, COSERVERINFO*, DWORD, MULTI_QI*); @@ -226,7 +226,7 @@ static VALUE ary_new_dim(VALUE myary, LO https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L226 static void ary_store_dim(VALUE myary, LONG *pid, LONG *plb, LONG dim, VALUE val); static void ole_const_load(ITypeLib *pTypeLib, VALUE klass, VALUE self); static HRESULT clsid_from_remote(VALUE host, VALUE com, CLSID *pclsid); -static VALUE ole_create_dcom(int argc, VALUE *argv, VALUE self); +static VALUE ole_create_dcom(VALUE self, VALUE ole, VALUE host, VALUE others); static VALUE ole_bind_obj(VALUE moniker, int argc, VALUE *argv, VALUE self); static VALUE fole_s_connect(int argc, VALUE *argv, VALUE self); static VALUE fole_s_const_load(int argc, VALUE *argv, VALUE self); @@ -2288,9 +2288,8 @@ clsid_from_remote(VALUE host, VALUE com, https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L2288 } static VALUE -ole_create_dcom(int argc, VALUE *argv, VALUE self) +ole_create_dcom(VALUE self, VALUE ole, VALUE host, VALUE others) { - VALUE ole, host, others; HRESULT hr; CLSID clsid; OLECHAR *pbuf; @@ -2308,7 +2307,6 @@ ole_create_dcom(int argc, VALUE *argv, V https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L2307 GetProcAddress(gole32, "CoCreateInstanceEx"); if (!gCoCreateInstanceEx) rb_raise(rb_eRuntimeError, "CoCreateInstanceEx is not supported in this environment"); - rb_scan_args(argc, argv, "2*", &ole, &host, &others); pbuf = ole_vstr2wc(ole); hr = CLSIDFromProgID(pbuf, &clsid); @@ -2898,7 +2896,7 @@ fole_initialize(int argc, VALUE *argv, V https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L2896 rb_raise(rb_eSecurityError, "Insecure Object Creation - %s", StringValuePtr(svr_name)); } - return ole_create_dcom(argc, argv, self); + return ole_create_dcom(self, svr_name, host, others); } /* get CLSID from OLE server name */ -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/