1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/stringio/stringio.c (strio_write): insufficiently filled string

being extended when overwriting.  [ruby-core:03836]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2004-11-29 07:06:21 +00:00
parent a229d2e740
commit a70f475dbb
3 changed files with 16 additions and 1 deletions

View file

@ -794,7 +794,7 @@ strio_write(self, str)
else {
if (ptr->pos + len > olen) {
rb_str_resize(ptr->string, ptr->pos + len);
MEMZERO(RSTRING(ptr->string)->ptr + olen, char, ptr->pos - olen);
MEMZERO(RSTRING(ptr->string)->ptr + olen, char, ptr->pos + len - olen);
}
else {
rb_str_modify(ptr->string);