* 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
This commit is contained in:
naruse 2010-07-08 08:18:07 +00:00
parent 646b699536
commit 3a6fd339d5
2 changed files with 10 additions and 4 deletions

View File

@ -1,8 +1,14 @@
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]
Thu Jul 8 08:16:57 2010 Aaron Patterson <aaron@tenderlovemaking.com> Thu Jul 8 08:16:57 2010 Aaron Patterson <aaron@tenderlovemaking.com>
* ext/psych/lib/psych/visitors/yaml_tree.rb (push): adding version * ext/psych/lib/psych/visitors/yaml_tree.rb (push): adding version
and header emit options. and header emit options.
* test/psych/test_psych.rb: corresponding test. * test/psych/test_psych.rb: corresponding test.
Thu Jul 8 08:01:03 2010 Aaron Patterson <aaron@tenderlovemaking.com> Thu Jul 8 08:01:03 2010 Aaron Patterson <aaron@tenderlovemaking.com>
@ -138,7 +144,7 @@ Sat Jul 3 09:47:26 2010 Aaron Patterson <aaron@tenderlovemaking.com>
* ext/psych/lib/psych/scalar_scanner.rb(parse_time): add method for * ext/psych/lib/psych/scalar_scanner.rb(parse_time): add method for
parsing times objects from a string. parsing times objects from a string.
* test/psych/test_date_time.rb: tests for dumping DateTime objects. * test/psych/test_date_time.rb: tests for dumping DateTime objects.
Sat Jul 3 09:13:55 2010 Aaron Patterson <aaron@tenderlovemaking.com> Sat Jul 3 09:13:55 2010 Aaron Patterson <aaron@tenderlovemaking.com>
@ -917,7 +923,7 @@ Mon May 31 23:44:22 2010 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/stubs.c: dirty hack for frameworks and stubs on MacOS X. * ext/tk/stubs.c: dirty hack for frameworks and stubs on MacOS X.
* ext/tk/lib/tk.rb: stop creating a dummy Tcl/Tk interpreter. * ext/tk/lib/tk.rb: stop creating a dummy Tcl/Tk interpreter.
And hide a root window before starting eventloop. (for ruby 1.9) And hide a root window before starting eventloop. (for ruby 1.9)
* ext/tk/tcltklib.c: add codes to support Ruby/Tk-Kit (Rubykit). * ext/tk/tcltklib.c: add codes to support Ruby/Tk-Kit (Rubykit).

View File

@ -513,7 +513,7 @@ rb_str_conv_enc_opts(VALUE str, rb_encoding *from, rb_encoding *to, int ecflags,
switch (ret) { switch (ret) {
case econv_destination_buffer_full: case econv_destination_buffer_full:
/* destination buffer short */ /* destination buffer short */
len *= 2; len = len < 2 ? 2 : len * 2;
rb_str_resize(newstr, len); rb_str_resize(newstr, len);
goto retry; goto retry;