From 7560a99d7bda2b986bfffcb2cfaf196e6f432144 Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Wed, 14 Nov 2018 22:55:33 +0100 Subject: [PATCH] check frame size for status new --- common/mux/frame.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/mux/frame.go b/common/mux/frame.go index 08812fc1..4d2ac032 100644 --- a/common/mux/frame.go +++ b/common/mux/frame.go @@ -120,6 +120,9 @@ func (f *FrameMetadata) UnmarshalFromBuffer(b *buf.Buffer) error { f.Target.Network = net.Network_Unknown if f.SessionStatus == SessionStatusNew { + if b.Len() < 8 { + return newError("insufficient buffer: ", b.Len()) + } network := TargetNetwork(b.Byte(4)) b.Advance(5)