From 61fbdef3496e6733ae73cc8432f06431fc9e5ac1 Mon Sep 17 00:00:00 2001 From: usa Date: Tue, 9 Jan 2007 08:50:04 +0000 Subject: * file.c (rb_find_file): should not call fpath_check() with NULL. fixed: [ruby-core:09867] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ file.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f9487cf0f4..9891b1f30d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Jan 9 17:48:38 2007 NAKAMURA Usaku + + * file.c (rb_find_file): should not call fpath_check() with NULL. + fixed: [ruby-core:09867] + Tue Jan 9 03:54:38 2007 Yukihiro Matsumoto * string.c (rb_str_upto): String#upto from empty string makes diff --git a/file.c b/file.c index c8b1e1b0bf..b71b0e958c 100644 --- a/file.c +++ b/file.c @@ -4298,7 +4298,9 @@ rb_find_file(VALUE path) if (!lpath) { return 0; /* no path, no load */ } - f = dln_find_file(f, lpath); + if (!(f = dln_find_file(f, lpath))) { + return 0; + } if (rb_safe_level() >= 1 && !fpath_check(f)) { rb_raise(rb_eSecurityError, "loading from unsafe file %s", f); } -- cgit v1.2.3