1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-08-06 11:31:54 +08:00

commands: Ensure argument parsing maintains total argument count, so that argument validation will fail if there are too many

This commit is contained in:
Matt Bell
2014-11-04 18:49:59 -08:00
committed by Juan Batiz-Benet
parent 116041c5ec
commit 37f05a8bf6
2 changed files with 8 additions and 0 deletions

View File

@ -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
}