Skip to content

Commit 1cb08e9

Browse files
committed
merge revision(s) r47153: [Backport ruby#10127]
* 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 ruby#10127] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@47325 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent fad6928 commit 1cb08e9

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Sun Aug 31 01:07:05 2014 Masaki Suketa <[email protected]>
2+
3+
* ext/win32ole/win32ole.c (ole_create_dcom): use the converted
4+
result if the argument can be converted to a string, to get rid
5+
of invalid access. Thanks to nobu. [ruby-dev:48467] [Bug #10127]
6+
17
Sun Aug 31 00:54:47 2014 Nobuyoshi Nakada <[email protected]>
28

39
* process.c (open): use UTF-8 version function to support

ext/win32ole/win32ole.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ static VALUE typelib_file_from_typelib(VALUE ole);
361361
static VALUE typelib_file(VALUE ole);
362362
static void ole_const_load(ITypeLib *pTypeLib, VALUE klass, VALUE self);
363363
static HRESULT clsid_from_remote(VALUE host, VALUE com, CLSID *pclsid);
364-
static VALUE ole_create_dcom(int argc, VALUE *argv, VALUE self);
364+
static VALUE ole_create_dcom(VALUE self, VALUE ole, VALUE host, VALUE others);
365365
static VALUE ole_bind_obj(VALUE moniker, int argc, VALUE *argv, VALUE self);
366366
static VALUE fole_s_connect(int argc, VALUE *argv, VALUE self);
367367
static VALUE fole_s_const_load(int argc, VALUE *argv, VALUE self);
@@ -2636,9 +2636,8 @@ clsid_from_remote(VALUE host, VALUE com, CLSID *pclsid)
26362636
}
26372637

26382638
static VALUE
2639-
ole_create_dcom(int argc, VALUE *argv, VALUE self)
2639+
ole_create_dcom(VALUE self, VALUE ole, VALUE host, VALUE others)
26402640
{
2641-
VALUE ole, host, others;
26422641
HRESULT hr;
26432642
CLSID clsid;
26442643
OLECHAR *pbuf;
@@ -2656,7 +2655,6 @@ ole_create_dcom(int argc, VALUE *argv, VALUE self)
26562655
GetProcAddress(gole32, "CoCreateInstanceEx");
26572656
if (!gCoCreateInstanceEx)
26582657
rb_raise(rb_eRuntimeError, "CoCreateInstanceEx is not supported in this environment");
2659-
rb_scan_args(argc, argv, "2*", &ole, &host, &others);
26602658

26612659
pbuf = ole_vstr2wc(ole);
26622660
hr = CLSIDFromProgID(pbuf, &clsid);
@@ -3270,7 +3268,7 @@ fole_initialize(int argc, VALUE *argv, VALUE self)
32703268
rb_raise(rb_eSecurityError, "Insecure Object Creation - %s",
32713269
StringValuePtr(svr_name));
32723270
}
3273-
return ole_create_dcom(argc, argv, self);
3271+
return ole_create_dcom(self, svr_name, host, others);
32743272
}
32753273

32763274
/* get CLSID from OLE server name */

version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#define RUBY_VERSION "2.1.2"
22
#define RUBY_RELEASE_DATE "2014-08-31"
3-
#define RUBY_PATCHLEVEL 214
3+
#define RUBY_PATCHLEVEL 215
44

55
#define RUBY_RELEASE_YEAR 2014
66
#define RUBY_RELEASE_MONTH 8

0 commit comments

Comments
 (0)