Added a check for malformed headers

This commit is contained in:
Eduard Urbach 2025-02-14 22:28:29 +01:00
parent d58f68f3fe
commit bb5d849cd9
Signed by: eduard
GPG key ID: 49226B848C78F6C8
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]