summaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-10-20 15:44:06 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-10-20 15:44:06 +0000
commit40f22b00e77ac75c759279c94cb9482b303dec6c (patch)
tree7be9c437cf2c4f4d6d05584ef3fca5e19bcab4a4 /io.c
parentc6f42424a7baa51a0db0695c2c368fc9d93fcfaa (diff)
downloadruby-40f22b00e77ac75c759279c94cb9482b303dec6c.tar.gz
ruby-40f22b00e77ac75c759279c94cb9482b303dec6c.tar.xz
ruby-40f22b00e77ac75c759279c94cb9482b303dec6c.zip
* parse.y (lex_getline): should not touch ruby_debug_lines if
RIPPER is defined. [ruby-dev:24547] * string.c (str_gsub): reentrant check. [ruby-dev:24432] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@7091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/io.c b/io.c
index 88fdd8ae8..2dc89cbeb 100644
--- a/io.c
+++ b/io.c
@@ -1131,6 +1131,9 @@ io_readpartial(argc, argv, io)
return str;
READ_CHECK(fptr->f);
+ if (RSTRING(str)->len != len) {
+ rb_raise(rb_eRuntimeError, "buffer string modified");
+ }
n = read_buffered_data(RSTRING(str)->ptr, len, fptr->f);
if (n <= 0) {
again: