From 4db73f684c2beffab8ea690b7e09b0ae55875e16 Mon Sep 17 00:00:00 2001 From: tjpcc Date: Sat, 12 Aug 2023 08:48:12 -0600 Subject: panic protection avoid assuming finger request lines come with CRLF --- finger/request.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'finger/request.go') diff --git a/finger/request.go b/finger/request.go index fad7fee..a18ff7e 100644 --- a/finger/request.go +++ b/finger/request.go @@ -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 } -- cgit v1.2.3