summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-05 13:18:23 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-05 13:18:23 +0000
commitbf0c93851a4345ed2986387bda5d72ca3afb4a75 (patch)
tree0815a59dcca8cb186c04c98ce7b09836e7c62b91 /string.c
parent3279020e87495064b13616e44abdb90405deff8e (diff)
* 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
Diffstat (limited to 'string.c')
-rw-r--r--string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/string.c b/string.c
index ea87e491cb..cc27550ebe 100644
--- a/string.c
+++ b/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;
}