[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


https://bugzilla.novell.com/show_bug.cgi?id=410006


           Summary: Number Overflow when IPv6 is enabled and using
                    IPGlobalProperties
           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
IPGlobalProperties.GetIPGlobalProperties().GetActiveUdpListeners()/GetActiveTcpListeners()

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),
NumberStyles.HexNumber),
                                                  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:

000080FE00000000FF0C0E020F7F09FE:007B

needs to be parsed as

0000:80FE:0000:0000:FF0C:0E02:0F7F:09FE


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