ammario / ipisp

Query IP address network information in Go
MIT License
66 stars 13 forks source link

Bug in IPv4 Parsing #9

Closed ghost closed 6 years ago

ghost commented 6 years ago

In dns_client.go, line 144, the following code causes an array out of bounds condition when a valid IPv4 address in 4 byte representation is passed in:

if p4 := ip.To4(); len(p4) == net.IPv4len {
        return fmt.Sprintf("%d.%d.%d.%d.origin.asn.cymru.com", ip[15], ip[14], ip[13], ip[12]), nil
}