From c052aafa7d2d590530ca798aeebfb89b59beb491 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Tue, 18 Jul 2017 13:57:35 +0200 Subject: fix panic --- key/enc.go | 2 +- key/pub.go | 2 +- key/sig.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/key/enc.go b/key/enc.go index 6ade4f6..6f9b0ff 100644 --- a/key/enc.go +++ b/key/enc.go @@ -46,7 +46,7 @@ func (v *Enc) UnmarshalBinary(data []byte) error { } func ParseEnc(data []byte, d KeyDeriver) (*Enc, error) { - var enc *Enc + enc := new(Enc) if err := enc.UnmarshalBinary(data); err != nil { return nil, err } diff --git a/key/pub.go b/key/pub.go index 6e3784e..2f1d358 100644 --- a/key/pub.go +++ b/key/pub.go @@ -34,7 +34,7 @@ func (v *Pub) UnmarshalBinary(data []byte) error { } func ParsePub(data []byte) (*Pub, error) { - var pub *Pub + pub := new(Pub) if err := pub.UnmarshalBinary(data); err != nil { return nil, err } diff --git a/key/sig.go b/key/sig.go index 73379cf..c6f1beb 100644 --- a/key/sig.go +++ b/key/sig.go @@ -24,7 +24,7 @@ func (v *Sig) UnmarshalBinary(data []byte) error { } func ParseSig(data []byte) (*Sig, error) { - var sig *Sig + sig := new(Sig) if err := sig.UnmarshalBinary(data); err != nil { return nil, err } -- cgit v1.2.3