[Mono-bugs] [Bug 605094] New: String.IndexOf() results in an infinite loop when it contains \u267B

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed May 12 05:26:06 EDT 2010


http://bugzilla.novell.com/show_bug.cgi?id=605094

http://bugzilla.novell.com/show_bug.cgi?id=605094#c0


           Summary: String.IndexOf() results in an infinite loop when it
                    contains \u267B
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.6.x
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: CORLIB
        AssignedTo: atsushi at ximian.com
        ReportedBy: aenomoto at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


modified copy from https://gist.github.com/1d6fd566dfc4b77acbee

The following code, in some or all language environment (the report was in
Japanese), results in an infinite loop. Most likely a string collation issue.

using System;
using System.IO;
using System.Threading;
using System.Collections.Generic;

public class Test {
    public static void Main (String[] args)
    {
        var s1 = "\u267B RT ";
        var s2 = "\u267B RT ー";
        //var pos = s2.LastIndexOf(s1, StringComparison.Ordinal);
        var pos = s2.LastIndexOf(s1);
        Console.WriteLine(pos);
    }
}

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list