diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-06 09:39:12 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-06 09:39:12 +0000 |
commit | 987ec6b78778bf8c7fb0ec0eb1c0dc80bfda0d6a (patch) | |
tree | dd9a1b2feecc38b626d904b08ac11e8ca537d17f | |
parent | 48659670706cd4baa195d4674cce2ccee905c839 (diff) |
* transcode.c (allocate_converted_string): fix overflow condition.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | transcode.c | 2 |
2 files changed, 5 insertions, 1 deletions
@@ -1,3 +1,7 @@ +Sat Sep 6 18:38:47 2008 Tanaka Akira <akr@fsij.org> + + * transcode.c (allocate_converted_string): fix overflow condition. + Sat Sep 6 15:06:21 2008 Tanaka Akira <akr@fsij.org> * transcode.c (sym_html): new variable. diff --git a/transcode.c b/transcode.c index cc3fc53c7a..ccb54dfff0 100644 --- a/transcode.c +++ b/transcode.c @@ -1445,7 +1445,7 @@ allocate_converted_string(const char *sname, const char *dname, res = rb_econv_convert(ec, &sp, str+len, &dp, dst_str+dst_bufsize, 0); dst_len = dp - dst_str; while (res == econv_destination_buffer_full) { - if (dst_bufsize * 2 < dst_bufsize) { + if (SIZE_MAX/2 < dst_bufsize) { goto fail; } dst_bufsize *= 2; |