panic protection

avoid assuming finger request lines come with CRLF
This commit is contained in:
tjpcc 2023-08-12 08:48:12 -06:00
parent 7efdcf9277
commit 4db73f684c
1 changed files with 1 additions and 1 deletions

View File

@ -53,7 +53,7 @@ func ParseRequest(rdr io.Reader) (*sr.Request, error) {
return nil, err
}
if line[len(line)-2] != '\r' {
if len(line) < 2 || line[len(line)-2] != '\r' {
return nil, InvalidFingerQuery
}