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:

committed by
Juan Batiz-Benet

parent
116041c5ec
commit
37f05a8bf6
@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user