Commit 37f05a8b authored by Matt Bell's avatar Matt Bell Committed by Juan Batiz-Benet

commands: Ensure argument parsing maintains total argument count, so that...

commands: Ensure argument parsing maintains total argument count, so that argument validation will fail if there are too many
parent 116041c5
......@@ -157,6 +157,10 @@ func parseArgs(stringArgs []string, cmd *cmds.Command) ([]interface{}, error) {
j++
}
if len(stringArgs)-j > 0 {
args = append(args, make([]interface{}, len(stringArgs)-j))
}
return args, nil
}
......
......@@ -83,6 +83,10 @@ func Parse(r *http.Request, root *cmds.Command) (cmds.Request, error) {
}
}
if valCount-1 > 0 {
args = append(args, make([]interface{}, valCount-1))
}
req := cmds.NewRequest(path, opts, args, cmd)
err = cmd.CheckArguments(req)
......
Markdown is supported
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