diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-05-30 05:18:16 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-05-30 05:18:16 +0000 |
commit | 9a4a7e8850f51c03646e26dfd2bbf568e48492a8 (patch) | |
tree | 8893f2e1f6738eb1242cb1b868732742ef77b9c1 | |
parent | 8567e3e8cbd54c7d595f24c94e3bcc8a4bf5f053 (diff) | |
download | ruby-9a4a7e8850f51c03646e26dfd2bbf568e48492a8.tar.gz |
variable.c: check length
* variable.c (check_autoload_required): check length first before
checking the first byte.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | variable.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/variable.c b/variable.c index 849be3abaa..d31066e6cf 100644 --- a/variable.c +++ b/variable.c @@ -2028,7 +2028,7 @@ check_autoload_required(VALUE mod, ID id, const char **loadingpath) } 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); |