mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2024-12-22 07:57:31 +00:00
Fix panic on invalid handshake length
This commit is contained in:
parent
4b48fd0b5f
commit
117e4b88f8
@ -101,6 +101,9 @@ func (m *version_metadata) decode(r io.Reader, password []byte) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(bs) < ed25519.SignatureSize {
|
||||||
|
return false
|
||||||
|
}
|
||||||
sig := bs[len(bs)-ed25519.SignatureSize:]
|
sig := bs[len(bs)-ed25519.SignatureSize:]
|
||||||
bs = bs[:len(bs)-ed25519.SignatureSize]
|
bs = bs[:len(bs)-ed25519.SignatureSize]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user