summaryrefslogtreecommitdiff
blob: a0e7444346f32f67af1afe77f0703cfd8394bc5c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From ebd0fc80d62eeb7b8556522256f8d035e013eb65 Mon Sep 17 00:00:00 2001
From: nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
Date: Sun, 2 Aug 2015 01:27:31 +0000
Subject: [PATCH] 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(-)

diff --git a/ext/tk/tcltklib.c b/ext/tk/tcltklib.c
index afcee3b..e305c13 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);
     }