diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-07-08 08:18:07 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-07-08 08:18:07 +0000 |
commit | 3a6fd339d54dc9b11a137567d6b1aefe5f3ec53d (patch) | |
tree | b4bcf039168d278bf58022f05472554e9ba39f93 /string.c | |
parent | 646b6995362aff14abfc08db24d091d01f5879d0 (diff) | |
download | ruby-3a6fd339d54dc9b11a137567d6b1aefe5f3ec53d.tar.gz |
* string.c (rb_str_conv_enc_opts): fix infinite loop because
of ISO-2022-JP conversion with empty string.
patched by Brian Buchanan [ruby-core:31107]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -513,7 +513,7 @@ rb_str_conv_enc_opts(VALUE str, rb_encoding *from, rb_encoding *to, int ecflags, switch (ret) { case econv_destination_buffer_full: /* destination buffer short */ - len *= 2; + len = len < 2 ? 2 : len * 2; rb_str_resize(newstr, len); goto retry; |