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

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Jan 11 07:04:25 EST 2010


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

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


--- Comment #2 from Alexander Petrossian <paf at yandex.ru> 2010-01-11 12:04:22 UTC ---
sure, Carlos.
latest 2.6.1 seems to have same problem:

rualpe-ws:~ paf$ mono -V
Mono JIT compiler version 2.6.1 (tarball Thu Dec 17 10:19:23 MST 2009)
Copyright (C) 2002-2008 Novell, Inc and Contributors. www.mono-project.com
    TLS:           normal
    GC:            Included Boehm (with typed GC)
    SIGSEGV:       normal
    Notification:  Thread + polling
    Architecture:  x86
    Disabled:      none
rualpe-ws:~ paf$ cd /tmp
rualpe-ws:tmp paf$ cat >a.cs
using System;

namespace IntParseZeroByte
{
        class MainClass
        {
                public static void Main (string[] args)
                {
                        string s = "2147483644\0";
                        int res = Int32.Parse (s);
                        Console.WriteLine ("Value = " + res);
                }
        }
}
rualpe-ws:tmp paf$ mcs a.cs;mono a.exe

Unhandled Exception: System.OverflowException: Value is too large
  at System.Int32.Parse (System.String s) [0x00000] in <filename unknown>:0 
  at IntParseZeroByte.MainClass.Main (System.String[] args) [0x00000] in
<filename unknown>:0 
rualpe-ws:tmp

-- 
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