keys: simplify end of buffer check
This commit is contained in:
parent
4803cc15c7
commit
61ea42c570
1 changed files with 1 additions and 3 deletions
|
@ -8,7 +8,6 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
gio "io"
|
|
||||||
"math/big"
|
"math/big"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/btcec"
|
"github.com/btcsuite/btcd/btcec"
|
||||||
|
@ -220,8 +219,7 @@ func (p *PublicKey) DecodeBytes(data []byte) error {
|
||||||
return b.Err
|
return b.Err
|
||||||
}
|
}
|
||||||
|
|
||||||
b.ReadB()
|
if b.Len() != 0 {
|
||||||
if b.Err != gio.EOF {
|
|
||||||
return errors.New("extra data")
|
return errors.New("extra data")
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in a new issue