From 117e4b88f8bd520948049c9482936fa490c64b1f Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Thu, 12 Oct 2023 19:12:17 +0100 Subject: [PATCH] Fix panic on invalid handshake length --- src/core/version.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/version.go b/src/core/version.go index e01fe10..332e18c 100644 --- a/src/core/version.go +++ b/src/core/version.go @@ -101,6 +101,9 @@ func (m *version_metadata) decode(r io.Reader, password []byte) bool { return false } + if len(bs) < ed25519.SignatureSize { + return false + } sig := bs[len(bs)-ed25519.SignatureSize:] bs = bs[:len(bs)-ed25519.SignatureSize]