ruby-changes:7662
From: akr <ko1@a...>
Date: Sat, 6 Sep 2008 18:39:26 +0900 (JST)
Subject: [ruby-changes:7662] Ruby:r19183 (trunk): * transcode.c (allocate_converted_string): fix overflow condition.
akr 2008-09-06 18:39:12 +0900 (Sat, 06 Sep 2008) New Revision: 19183 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=19183 Log: * transcode.c (allocate_converted_string): fix overflow condition. Modified files: trunk/ChangeLog trunk/transcode.c Index: ChangeLog =================================================================== --- ChangeLog (revision 19182) +++ ChangeLog (revision 19183) @@ -1,3 +1,7 @@ +Sat Sep 6 18:38:47 2008 Tanaka Akira <akr@f...> + + * transcode.c (allocate_converted_string): fix overflow condition. + Sat Sep 6 15:06:21 2008 Tanaka Akira <akr@f...> * transcode.c (sym_html): new variable. Index: transcode.c =================================================================== --- transcode.c (revision 19182) +++ transcode.c (revision 19183) @@ -1445,7 +1445,7 @@ 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; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/