Project

General

Profile

Bug #15803 ยป realpath-taint.patch

jeremyevans0 (Jeremy Evans), 04/27/2019 05:11 PM

View differences:

file.c
}
}
OBJ_INFECT(resolved, unresolved_path);
rb_obj_taint(resolved);
RB_GC_GUARD(unresolved_path);
RB_GC_GUARD(curdir);
return resolved;
test/ruby/test_file.rb
assert_predicate(File.realpath(base, dir), :tainted?)
base.untaint
dir.untaint
assert_not_predicate(File.realpath(base, dir), :tainted?)
assert_predicate(File.realpath(base, dir), :tainted?)
assert_predicate(Dir.chdir(dir) {File.realpath(base)}, :tainted?)
}
end
    (1-1/1)