summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortjpcc <tjp@ctrl-c.club>2023-08-12 08:48:12 -0600
committertjpcc <tjp@ctrl-c.club>2023-08-12 08:48:12 -0600
commit4db73f684c2beffab8ea690b7e09b0ae55875e16 (patch)
tree87b27b66f1f1286415d0a18ea1442134ecb2d31b
parent7efdcf9277c4a7be88179cb93d309d2f1e684fe6 (diff)
panic protection
avoid assuming finger request lines come with CRLF
-rw-r--r--finger/request.go2
1 files changed, 1 insertions, 1 deletions
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
}