* string.c (rb_str_splice): integer overflow for length.

[ruby-dev:31739]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@13343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2007-09-05 13:18:23 +00:00
parent 3279020e87
commit bf0c93851a
3 changed files with 9 additions and 4 deletions

View file

@ -1652,7 +1652,7 @@ rb_str_splice(str, beg, len, val)
}
beg += RSTRING(str)->len;
}
if (RSTRING(str)->len < beg + len) {
if (RSTRING(str)->len < len || RSTRING(str)->len < beg + len) {
len = RSTRING(str)->len - beg;
}