common: Fix sanity check on parsing gs messages

This commit is contained in:
TheLordScruffy 2023-09-17 21:37:10 -04:00
parent 326b5f7227
commit 0d60d91459
2 changed files with 3 additions and 1 deletions

View File

@ -17,7 +17,7 @@ var (
)
func ParseGameSpyMessage(msg string) ([]GameSpyCommand, error) {
if !strings.Contains(msg, `\\`) || !strings.Contains(msg, `\final\`) {
if !strings.Contains(msg, `\final\`) {
return nil, InvalidGameSpyCommand
}

View File

@ -95,6 +95,8 @@ func handleRequest(conn net.Conn) {
}
}
logging.Notice("GPCM", "Raw data:", string(buffer))
commands, err := common.ParseGameSpyMessage(string(buffer))
if err != nil {
logging.Notice("GPCM", "Error parsing message:", err.Error())