1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 01:57:12 -05:00

check frame size for status new

This commit is contained in:
Darien Raymond 2018-11-14 22:55:33 +01:00
parent 6c7dcc35ab
commit 7560a99d7b
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -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)