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)