forked from TrueCloudLab/neoneo-go
state: initialize PublicKey before decoding into it, fix #1061
These are pointers and decoding into a nil pointer is a bad idea.
This commit is contained in:
parent
dd6895b103
commit
90d3bcbdc3
1 changed files with 1 additions and 0 deletions
|
@ -125,6 +125,7 @@ func (s *NEOBalanceState) fromStackItem(item stackitem.Item) {
|
|||
votes := structItem[2].Value().([]stackitem.Item)
|
||||
s.Votes = make([]*keys.PublicKey, len(votes))
|
||||
for i, v := range votes {
|
||||
s.Votes[i] = new(keys.PublicKey)
|
||||
s.Votes[i].DecodeBytes(v.Value().([]byte))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue