mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-12-26 21:13:11 +01:00
etherswitchcfg(8) crashes when you don't set vlangroup members.
Fix this to require an argument. PR: kern/177872 Submitted by: Luiz Otavio O Souza <loos.br@gmail.com>
This commit is contained in:
parent
e1d6379074
commit
cdf0868a3d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=249748
@ -467,8 +467,11 @@ main(int argc, char *argv[])
|
||||
case MODE_PORT:
|
||||
case MODE_VLANGROUP:
|
||||
for(i=0; cmds[i].name != NULL; i++) {
|
||||
if (cfg.mode == cmds[i].mode && strcmp(argv[0], cmds[i].name) == 0
|
||||
&& argc >= cmds[i].args) {
|
||||
if (cfg.mode == cmds[i].mode && strcmp(argv[0], cmds[i].name) == 0) {
|
||||
if (argc < (cmds[i].args + 1)) {
|
||||
printf("%s needs an argument\n", cmds[i].name);
|
||||
break;
|
||||
}
|
||||
(cmds[i].f)(&cfg, argv);
|
||||
argc -= cmds[i].args;
|
||||
argv += cmds[i].args;
|
||||
|
Loading…
Reference in New Issue
Block a user