From 9d19712401f6ef2d6e6c2cce66d6d0ffce321fbe Mon Sep 17 00:00:00 2001 From: sucre <405462135@qq.com> Date: Fri, 10 Dec 2021 19:29:43 +0800 Subject: [PATCH] Update service.go fix out of range bug --- pkg/common/service.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/common/service.go b/pkg/common/service.go index b1ebe0a..c27d090 100644 --- a/pkg/common/service.go +++ b/pkg/common/service.go @@ -46,8 +46,11 @@ func ComparePackets(rcv []byte, rcvSize int, szBan *string, szSvcName *string) i var cFlag_MongoDB = []byte{0x4d, 0x09, 0x50, 0x00} var cBit_MongoDB []byte - - + + if len(buf) <4 { + goto Return + } + if rcvSize <4{ goto Return }