修复panic: runtime error: index out of range [12] with length 10

This commit is contained in:
lanrenwo 2022-09-05 19:09:00 +08:00 committed by GitHub
parent 091dc69f1d
commit b9b0fc811d
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 {