summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-19 23:12:56 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-19 23:12:56 +0000
commite62d2cb80c491a4337c1dfc6f580d06ea66b557e (patch)
tree51584d2db08f93d52c959a70299b9aae492b4075 /string.c
parent27f1dd40c348a5ef2217e1043cc08e0c0832c702 (diff)
parent3af6dda231c26524b65a02f8212d91ce37618aa9 (diff)
add tag v1_9_0_2
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_9_0_2@17464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/string.c b/string.c
index b962880d43..c19544deac 100644
--- a/string.c
+++ b/string.c
@@ -1562,6 +1562,9 @@ rb_enc_cr_str_buf_cat(VALUE str, const char *ptr, long len,
capa = RSTRING(str)->as.heap.aux.capa;
}
total = RSTRING_LEN(str)+len;
+ if (total < 0 || capa + 1 > LONG_MAX / 2) {
+ rb_raise(rb_eArgError, "string sizes too big");
+ }
if (capa <= total) {
while (total > capa) {
capa = (capa + 1) * 2;