channeldb/graph: write max 80 sig len for nodes

This commit is contained in:
Johan T. Halseth 2018-10-10 15:05:59 +02:00
parent 5dcd2a4530
commit 3d7bbd6d72
No known key found for this signature in database
GPG Key ID: 15BAADA29DA20D26

View File

@ -2839,6 +2839,12 @@ func putLightningNode(nodeBucket *bbolt.Bucket, aliasBucket *bbolt.Bucket,
}
}
sigLen := len(node.AuthSigBytes)
if sigLen > 80 {
return fmt.Errorf("max sig len allowed is 80, had %v",
sigLen)
}
err = wire.WriteVarBytes(&b, 0, node.AuthSigBytes)
if err != nil {
return err