Commit 6cde90b8 authored by ale's avatar ale
Browse files

Small safety check

parent c1632ea0
......@@ -34,6 +34,9 @@ func (s *SocketServer) ServeLine(ctx context.Context, lw unix.LineResponseWriter
// on any protocol error.
parts := bytes.SplitN(line, []byte{' '}, 2)
nargs := len(parts)
if nargs < 1 {
return errors.New("no command given")
}
cmd := string(parts[0])
switch {
case nargs == 1 && cmd == "quit":
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment