Date: Fri, 26 Jul 2019 01:42:25 +0000 (UTC) From: Kyle Evans <kevans@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350340 - stable/11/sbin/bectl Message-ID: <201907260142.x6Q1gPpF080828@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kevans Date: Fri Jul 26 01:42:24 2019 New Revision: 350340 URL: https://svnweb.freebsd.org/changeset/base/350340 Log: MFC r348328: bectl(8): Address Coverity complaints CID 1400451: case 0 is missing a break/return and falling through to the default case. waitpid(0, ...) makes little sense in the child, we likely wanted to terminate immediately. CID 1400453: size argument uses sizeof(char **) instead of sizeof(char *) and is assigned to a char **; sizeof's match but "this isn't a portable assumption". CID: 1400451, 1400453 Modified: stable/11/sbin/bectl/bectl_jail.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/bectl/bectl_jail.c ============================================================================== --- stable/11/sbin/bectl/bectl_jail.c Fri Jul 26 01:38:24 2019 (r350339) +++ stable/11/sbin/bectl/bectl_jail.c Fri Jul 26 01:42:24 2019 (r350340) @@ -155,7 +155,7 @@ build_jailcmd(char ***argvp, bool interactive, int arg nargv += argc; } - jargv = *argvp = calloc(nargv, sizeof(jargv)); + jargv = *argvp = calloc(nargv, sizeof(*jargv)); if (jargv == NULL) err(2, "calloc"); @@ -346,6 +346,7 @@ bectl_cmd_jail(int argc, char *argv[]) case 0: execv("/usr/sbin/jail", jargv); fprintf(stderr, "bectl jail: failed to execute\n"); + return (1); default: waitpid(pid, NULL, 0); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201907260142.x6Q1gPpF080828>