From 8044522691b1104b20e75ff7d4d0f659406e762f Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Tue, 29 Mar 2016 19:55:43 +0000 Subject: [PATCH] vendor: Update calmh/xdr to avoid unexpected string behavior (fixes #2882) --- vendor/github.com/calmh/xdr/unmarshal.go | 12 ++---------- vendor/manifest | 2 +- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/vendor/github.com/calmh/xdr/unmarshal.go b/vendor/github.com/calmh/xdr/unmarshal.go index 3115d555a..554861685 100644 --- a/vendor/github.com/calmh/xdr/unmarshal.go +++ b/vendor/github.com/calmh/xdr/unmarshal.go @@ -4,11 +4,7 @@ package xdr -import ( - "io" - "reflect" - "unsafe" -) +import "io" type Unmarshaller struct { Error error @@ -40,11 +36,7 @@ func (u *Unmarshaller) UnmarshalStringMax(max int) string { return "" } - var v string - p := (*reflect.StringHeader)(unsafe.Pointer(&v)) - p.Data = uintptr(unsafe.Pointer(&buf[0])) - p.Len = len(buf) - return v + return string(buf) } func (u *Unmarshaller) UnmarshalBytes() []byte { diff --git a/vendor/manifest b/vendor/manifest index 62199ce00..29e77ca27 100644 --- a/vendor/manifest +++ b/vendor/manifest @@ -22,7 +22,7 @@ { "importpath": "github.com/calmh/xdr", "repository": "https://github.com/calmh/xdr", - "revision": "b6e0c321c9b5b28ba5ee21e828323e4b982c6976", + "revision": "f9b9f8f7aa27725f5cabb699bd9099ca7ce09143", "branch": "master" }, {