[前][次][番号順一覧][スレッド一覧]

ruby-changes:38575

From: nobu <ko1@a...>
Date: Thu, 28 May 2015 14:53:30 +0900 (JST)
Subject: [ruby-changes:38575] nobu:r50656 (trunk): tkutil.c: check type

nobu	2015-05-28 14:53:05 +0900 (Thu, 28 May 2015)

  New Revision: 50656

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50656

  Log:
    tkutil.c: check type
    
    * ext/tk/tkutil/tkutil.c (cbsubst_get_subst_key): ensure the
      result type of a method call to be an array before accessing by
      RARRAY macros.

  Modified files:
    trunk/ext/tk/tkutil/tkutil.c
Index: ext/tk/tkutil/tkutil.c
===================================================================
--- ext/tk/tkutil/tkutil.c	(revision 50655)
+++ ext/tk/tkutil/tkutil.c	(revision 50656)
@@ -1461,6 +1461,7 @@ cbsubst_get_subst_key(self, str) https://github.com/ruby/ruby/blob/trunk/ext/tk/tkutil/tkutil.c#L1461
     char *buf, *ptr, *key;
 
     list = rb_funcall(cTclTkLib, ID_split_tklist, 1, str);
+    Check_Type(list, T_ARRAY);
     len = RARRAY_LEN(list);
 
     inf = cbsubst_get_ptr(self);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]