From a2b8925a94a672235ca6a16e584bf09026a957ab Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 2 Aug 2015 01:27:31 +0000 Subject: 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 --- ext/tk/tcltklib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ext') 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); } -- cgit v1.2.3