aboutsummaryrefslogtreecommitdiffstats
path: root/rlp/decode.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2014-11-17 19:02:08 +0800
committerFelix Lange <fjl@twurst.com>2014-11-17 19:02:08 +0800
commitbd0a50fdc3550eba979b132a92960f1e08110033 (patch)
tree316b21e90b4c2a1745c50a368529ffdc6d3be879 /rlp/decode.go
parent74266d5bbd95ac07882b09230aec876bf7704f69 (diff)
downloaddexon-bd0a50fdc3550eba979b132a92960f1e08110033.tar
dexon-bd0a50fdc3550eba979b132a92960f1e08110033.tar.gz
dexon-bd0a50fdc3550eba979b132a92960f1e08110033.tar.bz2
dexon-bd0a50fdc3550eba979b132a92960f1e08110033.tar.lz
dexon-bd0a50fdc3550eba979b132a92960f1e08110033.tar.xz
dexon-bd0a50fdc3550eba979b132a92960f1e08110033.tar.zst
dexon-bd0a50fdc3550eba979b132a92960f1e08110033.zip
rlp: fix pointer reuse
Diffstat (limited to 'rlp/decode.go')
-rw-r--r--rlp/decode.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/rlp/decode.go b/rlp/decode.go
index 1a51e7130..96d912f56 100644
--- a/rlp/decode.go
+++ b/rlp/decode.go
@@ -309,6 +309,7 @@ func makePtrDecoder(typ reflect.Type) (decoder, error) {
dec := func(s *Stream, val reflect.Value) (err error) {
_, size, err := s.Kind()
if err != nil || size == 0 && s.byteval == 0 {
+ val.Set(reflect.Zero(typ)) // set to nil
return err
}
newval := val