Author: raja
Date: 2005-06-14 08:20:57 -0400 (Tue, 14 Jun 2005)
New Revision: 45960

Modified:
   trunk/mcs/class/System/System.Text.RegularExpressions/ChangeLog
   trunk/mcs/class/System/System.Text.RegularExpressions/parser.cs
Log:
* parser.cs (Parser.ConsumeWhitespace): Add bounds check.


Modified: trunk/mcs/class/System/System.Text.RegularExpressions/ChangeLog
===================================================================
--- trunk/mcs/class/System/System.Text.RegularExpressions/ChangeLog     
2005-06-14 11:57:50 UTC (rev 45959)
+++ trunk/mcs/class/System/System.Text.RegularExpressions/ChangeLog     
2005-06-14 12:20:57 UTC (rev 45960)
@@ -1,5 +1,7 @@
 2005-06-14  Raja R Harinath  <[EMAIL PROTECTED]>
 
+       * parser.cs (Parser.ConsumeWhitespace): Add bounds check.
+
        Fix #74753.
        * Match.cs (Match) [zero-argument variant]: Make private.
        * GroupCollection (Item) [string variant]: Don't look for the

Modified: trunk/mcs/class/System/System.Text.RegularExpressions/parser.cs
===================================================================
--- trunk/mcs/class/System/System.Text.RegularExpressions/parser.cs     
2005-06-14 11:57:50 UTC (rev 45959)
+++ trunk/mcs/class/System/System.Text.RegularExpressions/parser.cs     
2005-06-14 12:20:57 UTC (rev 45960)
@@ -1033,10 +1033,7 @@
                }
 
                private void ConsumeWhitespace (bool ignore) {
-                       while (true) {
-                               if (ptr >= pattern.Length)
-                                       break;
-                       
+                       while (ptr < pattern.Length) {
                                if (pattern[ptr] == '(') {
                                        if (ptr + 3 >= pattern.Length)
                                                return;
@@ -1045,7 +1042,7 @@
                                                return;
 
                                        ptr += 3;
-                                       while (pattern[ptr ++] != ')')
+                                       while (ptr < pattern.Length && 
pattern[ptr ++] != ')')
                                                /* ignore */ ;
                                }
                                else if (ignore && pattern[ptr] == '#') {

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to