From 3d7bbd6d7216821b97a80c5496a70d458f25814e Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Wed, 10 Oct 2018 15:05:59 +0200 Subject: [PATCH] channeldb/graph: write max 80 sig len for nodes --- channeldb/graph.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/channeldb/graph.go b/channeldb/graph.go index 70eb55ee..21680eb4 100644 --- a/channeldb/graph.go +++ b/channeldb/graph.go @@ -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