mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
* 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
This commit is contained in:
parent
4865967070
commit
987ec6b787
2 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue