panic protection
avoid assuming finger request lines come with CRLF
This commit is contained in:
parent
7efdcf9277
commit
4db73f684c
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue