]> Cypherpunks repositories - gostls13.git/commitdiff
net: fix a bad cast in dnsmsg.go
authorAlexey Borzenkov <snaury@gmail.com>
Thu, 1 Nov 2012 16:57:44 +0000 (12:57 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 1 Nov 2012 16:57:44 +0000 (12:57 -0400)
Incorrect cast was causing panics when
calling String() on dnsMsg with dnsRR_A
answers.

R=golang-dev, dave, rsc
CC=golang-dev
https://golang.org/cl/6818043

src/pkg/net/dnsmsg.go

index b6ebe117363b3a821e9078c56b68ee1d3937dd01..161afb2a55675eaaa855c4840c97b4c9af3c2e18 100644 (file)
@@ -618,7 +618,7 @@ func printStruct(any dnsStruct) string {
                s += name + "="
                switch tag {
                case "ipv4":
-                       i := val.(uint32)
+                       i := *val.(*uint32)
                        s += IPv4(byte(i>>24), byte(i>>16), byte(i>>8), byte(i)).String()
                case "ipv6":
                        i := val.([]byte)