[前][次][番号順一覧][スレッド一覧]

ruby-changes:36216

From: naruse <ko1@a...>
Date: Thu, 6 Nov 2014 19:42:24 +0900 (JST)
Subject: [ruby-changes:36216] naruse:r48297 (trunk): * re.c (unescape_nonascii): cast -1 for the case char is unsigned char.

naruse	2014-11-06 19:42:10 +0900 (Thu, 06 Nov 2014)

  New Revision: 48297

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=48297

  Log:
    * re.c (unescape_nonascii): cast -1 for the case char is unsigned char.
      If char is signed char, for example gcc for ARM or ppc64, it caused
      infinite loop.
      http://kmuto.jp/build-ruby/arm/ruby-trunk/log/20141106T013005Z.fail.html.gz
      http://rubyci.blob.core.windows.net/f19p8/ruby-trunk/log/20141106T090217Z.fail.html.gz

  Modified files:
    trunk/ChangeLog
    trunk/re.c
Index: re.c
===================================================================
--- re.c	(revision 48296)
+++ re.c	(revision 48297)
@@ -2286,7 +2286,7 @@ unescape_nonascii(const char *p, const c https://github.com/ruby/ruby/blob/trunk/re.c#L2286
                 p = p-2;
 		if (enc == rb_usascii_encoding()) {
 		    c = read_escaped_byte(&p, end, err);
-		    if (c == -1) return -1;
+		    if (c == (char)-1) return -1;
 		    rb_str_buf_cat(buf, &c, 1);
 		}
 		else {
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 48296)
+++ ChangeLog	(revision 48297)
@@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Nov  6 19:27:34 2014  NARUSE, Yui  <naruse@r...>
+
+	* re.c (unescape_nonascii): cast -1 for the case char is unsigned char.
+	  If char is signed char, for example gcc for ARM or ppc64, it caused
+	  infinite loop.
+	  http://kmuto.jp/build-ruby/arm/ruby-trunk/log/20141106T013005Z.fail.html.gz
+	  http://rubyci.blob.core.windows.net/f19p8/ruby-trunk/log/20141106T090217Z.fail.html.gz
+
 Thu Nov  6 09:53:18 2014  Eric Wong  <e@8...>
 
 	* lib/uri/rfc2396_parser.rb (initialize): reduce bytecode size

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]