Skip to content

Commit

Permalink
clean gcc ananlyzer warnings - #3377
Browse files Browse the repository at this point in the history
  • Loading branch information
netblue30 committed Sep 28, 2020
1 parent c6166d7 commit 823dd6b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/firejail/paths.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ static void init_paths(void) {
paths = calloc(path_cnt, sizeof(char *));
if (!paths)
errExit("calloc");
memset(paths, 0, path_cnt * sizeof(char *)); // get rid of false positive error from GCC static analyzer

// fill in 'paths' with pointers to elements of 'path'
unsigned int i = 0, j;
Expand Down
3 changes: 2 additions & 1 deletion src/firejail/sbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ int sbox_run(unsigned filtermask, int num, ...) {

int sbox_run_v(unsigned filtermask, char * const arg[]) {
EUID_ROOT();
assert(arg);

if (arg_debug) {
printf("sbox run: ");
Expand All @@ -288,7 +289,7 @@ int sbox_run_v(unsigned filtermask, char * const arg[]) {
if (waitpid(child, &status, 0) == -1 ) {
errExit("waitpid");
}
if (WIFEXITED(status) && status != 0) {
if (WIFEXITED(status) && WEXITSTATUS(status) != 0) {
fprintf(stderr, "Error: failed to run %s\n", arg[0]);
exit(1);
}
Expand Down

0 comments on commit 823dd6b

Please sign in to comment.