ruby-changes:43133
From: nobu <ko1@a...>
Date: Mon, 30 May 2016 14:18:21 +0900 (JST)
Subject: [ruby-changes:43133] nobu:r55207 (trunk): variable.c: check length
nobu 2016-05-30 14:18:16 +0900 (Mon, 30 May 2016) New Revision: 55207 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55207 Log: variable.c: check length * variable.c (check_autoload_required): check length first before checking the first byte. Modified files: trunk/variable.c Index: variable.c =================================================================== --- variable.c (revision 55206) +++ variable.c (revision 55207) @@ -2028,7 +2028,7 @@ check_autoload_required(VALUE mod, ID id https://github.com/ruby/ruby/blob/trunk/variable.c#L2028 } file = ele->feature; Check_Type(file, T_STRING); - if (!RSTRING_PTR(file) || !*RSTRING_PTR(file)) { + if (!RSTRING_LEN(file) || !*RSTRING_PTR(file)) { rb_raise(rb_eArgError, "empty file name"); } loading = RSTRING_PTR(file); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/