[Mono-bugs] [Bug 76519][Nor] New - LastIndexOfAny exhibits different behavior than MS implementation

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sat Oct 22 13:33:00 EDT 2005


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by junkmail at bobsilva.com.

http://bugzilla.ximian.com/show_bug.cgi?id=76519

--- shadow/76519	2005-10-22 13:33:00.000000000 -0400
+++ shadow/76519.tmp.16961	2005-10-22 13:33:00.000000000 -0400
@@ -0,0 +1,40 @@
+Bug#: 76519
+Product: Mono: Class Libraries
+Version: 1.1
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: junkmail at bobsilva.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: LastIndexOfAny exhibits different behavior than MS implementation
+
+Description of Problem:
+
+Implementation of "public int LastIndexOfAny (char [] anyOf, int 
+startIndex, int count)" argument checking appears to be incorrect.
+
+if ((startIndex < 0) || (startIndex > this.Length))
+
+should be
+
+if ((startIndex < 0) || (startIndex >= this.Length))
+
+Steps to reproduce the problem:
+
+1. String str = "Mono";
+2. char [] find = {'M'};
+3. int pos = str.LastIndexOfAny(find, str.Length, 1);
+
+Expected Results:
+
+ArgumentOutOfRange exception.
+
+startIndex specifies a position not within this instance.


More information about the mono-bugs mailing list