diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | string.c | 2 |
2 files changed, 7 insertions, 1 deletions
@@ -1,3 +1,9 @@ +Thu Jul 8 15:47:34 2010 NARUSE, Yui <naruse@ruby-lang.org> + + * 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] + Wed Jul 7 10:26:20 2010 NARUSE, Yui <naruse@ruby-lang.org> * missing/close.c: ignore ECONNRESET. @@ -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; |