Added a check for malformed headers

This commit is contained in:
2025-02-14 22:28:29 +01:00
parent e787609322
commit a4177508f1
3 changed files with 25 additions and 0 deletions

View File

@ -177,6 +177,10 @@ func (s *server) handleConnection(conn net.Conn) {
continue
}
if colon > len(message)-4 {
continue
}
key := message[:colon]
value := message[colon+2 : len(message)-2]