From e887368be6bb86bf0df1c05b061d6177f6539bc3 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 20 Sep 2021 14:30:00 +0300 Subject: [PATCH] [#340] owner: Prevent potential NPE in NEO3WalletFromPublicKey Copy `Curve` field of `ecdsa.PublicKey` arg to `keys.PublicKey` instance in `NEO3WalletFromPublicKey` function. Signed-off-by: Leonard Lyubich --- pkg/owner/wallet.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/owner/wallet.go b/pkg/owner/wallet.go index afca654d..83d3b47b 100644 --- a/pkg/owner/wallet.go +++ b/pkg/owner/wallet.go @@ -22,8 +22,9 @@ func NEO3WalletFromPublicKey(key *ecdsa.PublicKey) (*NEO3Wallet, error) { } neoPublicKey := keys.PublicKey{ - X: key.X, - Y: key.Y, + Curve: key.Curve, + X: key.X, + Y: key.Y, } d, err := base58.Decode(neoPublicKey.Address())