Merge pull request #134 from lanrenwo/patch-1

修复panic: runtime error: index out of range [12] with length 10
This commit is contained in:
bjdgyc 2022-09-08 16:01:45 +08:00 committed by GitHub
commit 89e1828b5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -17,6 +17,9 @@ var (
)
func onTCP(payload []byte) (uint8, string) {
if len(payload) < 13 {
return acc_proto_tcp, ""
}
ihl := (payload[12] & 0xf0) >> 2
data := payload[ihl:]
for _, parser := range tcpParsers {