[#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 <leonard@nspcc.ru>
This commit is contained in:
parent
6d0b3135ff
commit
e887368be6
1 changed files with 3 additions and 2 deletions
|
@ -22,8 +22,9 @@ func NEO3WalletFromPublicKey(key *ecdsa.PublicKey) (*NEO3Wallet, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
neoPublicKey := keys.PublicKey{
|
neoPublicKey := keys.PublicKey{
|
||||||
X: key.X,
|
Curve: key.Curve,
|
||||||
Y: key.Y,
|
X: key.X,
|
||||||
|
Y: key.Y,
|
||||||
}
|
}
|
||||||
|
|
||||||
d, err := base58.Decode(neoPublicKey.Address())
|
d, err := base58.Decode(neoPublicKey.Address())
|
||||||
|
|
Loading…
Reference in a new issue