Skip to content

Commit 57b892e

Browse files
mkwcatppebb
andcommitted
Fix serverbrowser crash on malformed packet (#102)
Co-Authored-By: ppeb <36719558+ppebb@users.noreply.github.com>
1 parent ec9f2f3 commit 57b892e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎serverbrowser/server.go‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,11 @@ func handleServerListRequest(moduleName string, connIndex uint64, address string
336336

337337
func handleSendMessageRequest(moduleName string, connIndex uint64, address string, buffer []byte) {
338338
common.MaybeUnused(connIndex)
339+
340+
if len(buffer) < 9 {
341+
return
342+
}
343+
339344
// Read search ID from buffer
340345
searchID := uint64(binary.BigEndian.Uint32(buffer[3:7]))
341346
searchID |= uint64(binary.BigEndian.Uint16(buffer[7:9])) << 32

0 commit comments

Comments
 (0)