diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-07-02 10:14:05 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-07-02 10:14:05 +0000 |
commit | ec4ca0fcbb406e10bc00be01e376a32bd87af88c (patch) | |
tree | 59ac15259e17064fe000aba9fa784ebefe6e155d /io.c | |
parent | 318deef393dd9f7e66f7c548b12d53e24a877600 (diff) |
* io.c (argf_inplace_mode_set): prohibits an assignment
of a tainted value. Patch by unak.
* util.c, file.c: prevents a buffer over-run on windows.
Patch by unak.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@28522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -9548,6 +9548,9 @@ opt_i_get(ID id, VALUE *var) static VALUE argf_inplace_mode_set(VALUE argf, VALUE val) { + if (rb_safe_level() >= 1 && OBJ_TAINTED(val)) + rb_insecure_operation(); + if (!RTEST(val)) { if (ARGF.inplace) free(ARGF.inplace); ARGF.inplace = 0; |