aboutsummaryrefslogtreecommitdiffstats
path: root/ext/tk
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-02 01:27:31 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-02 01:27:31 +0000
commita2b8925a94a672235ca6a16e584bf09026a957ab (patch)
tree77c45004c8a85b8b44d372720c6d7670a0cddc33 /ext/tk
parent03fcd385b28bcb2ae5eb5afcfdf04e4665a69feb (diff)
downloadruby-a2b8925a94a672235ca6a16e584bf09026a957ab.tar.gz
tcltklib.c: check argument
* ext/tk/tcltklib.c (ip_cancel_eval_core): check argument type and length. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk')
-rw-r--r--ext/tk/tcltklib.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/tk/tcltklib.c b/ext/tk/tcltklib.c
index afcee3b072..e305c1327c 100644
--- a/ext/tk/tcltklib.c
+++ b/ext/tk/tcltklib.c
@@ -7745,7 +7745,8 @@ ip_cancel_eval_core(interp, msg, flag)
if (NIL_P(msg)) {
msg_obj = NULL;
} else {
- msg_obj = Tcl_NewStringObj(RSTRING_PTR(msg), RSTRING_LEN(msg));
+ char *s = StringValuePtr(msg);
+ msg_obj = Tcl_NewStringObj(s, RSTRING_LENINT(msg));
Tcl_IncrRefCount(msg_obj);
}