[Mono-bugs] [Bug 410006] New: Number Overflow when IPv6 is enabled and using IPGlobalProperties

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Jul 17 10:59:31 EDT 2008


           Summary: Number Overflow when IPv6 is enabled and using
           Product: Mono: Class Libraries
           Version: SVN
          Platform: i686
        OS/Version: Red Hat 8.0
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: smcnally at brandassetdigital.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Beta-Customer

When calling

you can encounter a number overflow.

this is caused by trying to parse an IPv6 address as a long value.

line 189: 
IPEndPoint ToEndpoint (string s)
     int idx = s.IndexOf (':');
     return new IPEndPoint (long.Parse (s.Substring (0, idx),
                                                  int.Parse (s.Substring (idx +
1), NumberStyles.HexNumber));

As we know IPv6 addresses do not fit within a long.  These need to be parsed
with IPAddress.Parse  after inserting the proper ":" delimiters.

example address that causes crash:


needs to be parsed as


Configure bugmail: https://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