Don't retain references to passed byte slices (#40)
This commit is contained in:
parent
9caf737bc7
commit
10a9a0f557
4 changed files with 17 additions and 9 deletions
|
|
@ -52,7 +52,7 @@ func NewKeyFromReader(r io.Reader) (key *Key, err error) {
|
|||
|
||||
// NewKey creates a new key from the first key in the unarmored binary data
|
||||
func NewKey(binKeys []byte) (key *Key, err error) {
|
||||
return NewKeyFromReader(bytes.NewReader(binKeys))
|
||||
return NewKeyFromReader(bytes.NewReader(clone(binKeys)))
|
||||
}
|
||||
|
||||
// NewKeyFromArmored creates a new key from the first key in an armored
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue