aboutsummaryrefslogtreecommitdiffstats
path: root/ext/win32ole/win32ole.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/win32ole/win32ole.c')
-rw-r--r--ext/win32ole/win32ole.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c
index 14147ab7bc..02ad82b4d4 100644
--- a/ext/win32ole/win32ole.c
+++ b/ext/win32ole/win32ole.c
@@ -860,6 +860,11 @@ ole_vstr2wc(VALUE vstr)
LPWSTR pw;
st_data_t data;
struct st_table *tbl = DATA_PTR(enc2cp_hash);
+
+ /* do not type-conversion here to prevent from other arguments
+ * changing (if exist) */
+ Check_Type(vstr, T_STRING);
+
enc = rb_enc_get(vstr);
if (st_lookup(tbl, (VALUE)enc | FIXNUM_FLAG, &data)) {