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

ruby-changes:20570

From: nobu <ko1@a...>
Date: Fri, 22 Jul 2011 19:06:01 +0900 (JST)
Subject: [ruby-changes:20570] nobu:r32618 (ruby_1_9_3, trunk): * parse.y (rb_enc_symname2_p): get rid of potential out-of-bound

nobu	2011-07-22 19:05:49 +0900 (Fri, 22 Jul 2011)

  New Revision: 32618

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

  Log:
    * parse.y (rb_enc_symname2_p): get rid of potential out-of-bound
      access.

  Modified files:
    branches/ruby_1_9_3/ChangeLog
    branches/ruby_1_9_3/parse.y
    trunk/ChangeLog
    trunk/parse.y

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 32617)
+++ ChangeLog	(revision 32618)
@@ -1,3 +1,8 @@
+Fri Jul 22 19:05:47 2011  Nobuyoshi Nakada  <nobu@r...>
+
+	* parse.y (rb_enc_symname2_p): get rid of potential out-of-bound
+	  access.
+
 Fri Jul 22 13:55:59 2011  Eric Hodel  <drbrain@s...>
 
 	* lib/net/http.rb:  Net::HTTP#finish is used to manually close
Index: parse.y
===================================================================
--- parse.y	(revision 32617)
+++ parse.y	(revision 32618)
@@ -9685,7 +9685,7 @@
     const char *e = m + len;
     int localid = FALSE;
 
-    if (!m) return FALSE;
+    if (!m || len <= 0) return FALSE;
     switch (*m) {
       case '\0':
 	return FALSE;
@@ -9738,8 +9738,8 @@
 	break;
 
       case '!':
+	if (len == 1) return FALSE;
 	switch (*++m) {
-	  case '\0': return TRUE;
 	  case '=': case '~': ++m; break;
 	  default: return FALSE;
 	}
Index: ruby_1_9_3/ChangeLog
===================================================================
--- ruby_1_9_3/ChangeLog	(revision 32617)
+++ ruby_1_9_3/ChangeLog	(revision 32618)
@@ -1,3 +1,8 @@
+Fri Jul 22 19:05:47 2011  Nobuyoshi Nakada  <nobu@r...>
+
+	* parse.y (rb_enc_symname2_p): get rid of potential out-of-bound
+	  access.
+
 Fri Jul 22 13:55:59 2011  Eric Hodel  <drbrain@s...>
 
 	* lib/net/http.rb:  Net::HTTP#finish is used to manually close
Index: ruby_1_9_3/parse.y
===================================================================
--- ruby_1_9_3/parse.y	(revision 32617)
+++ ruby_1_9_3/parse.y	(revision 32618)
@@ -9685,7 +9685,7 @@
     const char *e = m + len;
     int localid = FALSE;
 
-    if (!m) return FALSE;
+    if (!m || len <= 0) return FALSE;
     switch (*m) {
       case '\0':
 	return FALSE;
@@ -9738,8 +9738,8 @@
 	break;
 
       case '!':
+	if (len == 1) return FALSE;
 	switch (*++m) {
-	  case '\0': return TRUE;
 	  case '=': case '~': ++m; break;
 	  default: return FALSE;
 	}

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

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