From: Ian Lance Taylor Date: Fri, 15 Apr 2011 13:49:39 +0000 (-0700) Subject: gob: when decoding a string, allocate a string, not a []byte. X-Git-Tag: weekly.2011-04-27~139 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=a696da10e0e65bb839d5a4a1c173b179f76def62;p=gostls13.git gob: when decoding a string, allocate a string, not a []byte. R=r, r2 CC=golang-dev https://golang.org/cl/4430042 --- diff --git a/src/pkg/gob/decode.go b/src/pkg/gob/decode.go index 4da7b5c379..aebe75e345 100644 --- a/src/pkg/gob/decode.go +++ b/src/pkg/gob/decode.go @@ -406,7 +406,7 @@ func decUint8Array(i *decInstr, state *decoderState, p unsafe.Pointer) { func decString(i *decInstr, state *decoderState, p unsafe.Pointer) { if i.indir > 0 { if *(*unsafe.Pointer)(p) == nil { - *(*unsafe.Pointer)(p) = unsafe.Pointer(new([]byte)) + *(*unsafe.Pointer)(p) = unsafe.Pointer(new(string)) } p = *(*unsafe.Pointer)(p) }