[Mono-bugs] [Bug 508681] New: OverflowException on int.Parse(string with zero byte at the end)

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Jun 1 09:06:44 EDT 2009


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


           Summary: OverflowException on int.Parse(string with zero byte
                    at the end)
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.0.x
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: paf at yandex.ru
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Created an attachment (id=295472)
 --> (http://bugzilla.novell.com/attachment.cgi?id=295472)
run it, and it will throw the exception

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; ru; rv:1.9.0.9)
Gecko/2009040821 Firefox/3.0.9

int.Parse("2147483644\0")

Unhandled Exception: System.OverflowException: Value is too large
  at System.Int32.Parse (System.String s) [0x00000]


Reproducible: Always

Steps to Reproduce:
1.
2.
3.
Actual Results:  
Parse method throws an exception.

Expected Results:  
parse the value without any exception.

I feel we should treat \0 character as whitespace character.
(works quite OK if \0 character is replaced by SPACE character)

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


More information about the mono-bugs mailing list