Browse Source

Fix panic in `address.GetKey()` (fixes #860)

tags/v0.4.1
Neil Alexander 2 months ago
parent
commit
4859accbb0
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      src/address/address.go

+ 5
- 1
src/address/address.go View File

@@ -129,7 +129,11 @@ func (a *Address) GetKey() ed25519.PublicKey {
bits <<= byte(idx % 8)
keyIdx := keyOffset + (idx - addrOffset)
bits >>= byte(keyIdx % 8)
key[keyIdx/8] |= bits
idx := keyIdx / 8
if idx >= len(key) {
break
}
key[idx] |= bits
}
for idx := range key {
key[idx] = ^key[idx]


Loading…
Cancel
Save