Date: Mon, 22 Apr 2013 05:40:01 GMT From: dfilter@FreeBSD.ORG (dfilter service) To: freebsd-embedded@FreeBSD.org Subject: Re: bin/177872: commit references a PR Message-ID: <201304220540.r3M5e172023506@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/177872; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: bin/177872: commit references a PR Date: Mon, 22 Apr 2013 05:30:27 +0000 (UTC) Author: adrian Date: Mon Apr 22 05:30:20 2013 New Revision: 249748 URL: http://svnweb.freebsd.org/changeset/base/249748 Log: 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> Modified: head/sbin/etherswitchcfg/etherswitchcfg.c Modified: head/sbin/etherswitchcfg/etherswitchcfg.c ============================================================================== --- head/sbin/etherswitchcfg/etherswitchcfg.c Mon Apr 22 05:27:13 2013 (r249747) +++ head/sbin/etherswitchcfg/etherswitchcfg.c Mon Apr 22 05:30:20 2013 (r249748) @@ -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; _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201304220540.r3M5e172023506>