diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-08 01:40:49 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-08 01:40:49 +0000 |
| commit | 6f7bd54aeaced6081743482d3228e9b7916a169d (patch) | |
| tree | c4d6052017bf192a4eb9e4c62d4118d10cbc1eaa /load.c | |
| parent | 499e54aebf7c5a28fba98352899f4db43b6ebc75 (diff) | |
| download | ruby-6f7bd54aeaced6081743482d3228e9b7916a169d.tar.gz ruby-6f7bd54aeaced6081743482d3228e9b7916a169d.tar.xz ruby-6f7bd54aeaced6081743482d3228e9b7916a169d.zip | |
* load.c (rb_require_safe): should check fname path after $SAFE is
properly set. [ruby-dev:34268]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'load.c')
| -rw-r--r-- | load.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -520,8 +520,6 @@ rb_require_safe(VALUE fname, int safe) } volatile saved; char *volatile ftptr = 0; - FilePathValue(fname); - RB_GC_GUARD(fname) = rb_str_new4(fname); PUSH_TAG(); saved.safe = rb_safe_level(); if ((state = EXEC_TAG()) == 0) { @@ -530,6 +528,8 @@ rb_require_safe(VALUE fname, int safe) int found; rb_set_safe_level_force(safe); + FilePathValue(fname); + RB_GC_GUARD(fname) = rb_str_new4(fname); found = search_required(fname, &path); if (found) { if (!path || !(ftptr = load_lock(RSTRING_PTR(path)))) { |
