mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
* 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:
parent
3279020e87
commit
bf0c93851a
3 changed files with 9 additions and 4 deletions
2
string.c
2
string.c
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue