Explicitly ensure length > 0 to sign vote extension

Signed-off-by: Thane Thomson <connect@thanethomson.com>
This commit is contained in:
Thane Thomson
2022-03-20 14:25:03 -04:00
parent 25a7312e35
commit e0ca4549de

View File

@@ -95,7 +95,7 @@ func (pv MockPV) SignVote(ctx context.Context, chainID string, vote *tmproto.Vot
return err
}
vote.Signature = sig
if vote.Extension != nil {
if len(vote.Extension) > 0 {
vote.ExtensionSignature, err = pv.PrivKey.Sign(vote.Extension)
if err != nil {
return err