diff options
-rw-r--r-- | src/firejail/paths.c | 1 | ||||
-rw-r--r-- | src/firejail/sbox.c | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/firejail/paths.c b/src/firejail/paths.c index f03d98e29..5de704bef 100644 --- a/src/firejail/paths.c +++ b/src/firejail/paths.c | |||
@@ -45,6 +45,7 @@ static void init_paths(void) { | |||
45 | paths = calloc(path_cnt, sizeof(char *)); | 45 | paths = calloc(path_cnt, sizeof(char *)); |
46 | if (!paths) | 46 | if (!paths) |
47 | errExit("calloc"); | 47 | errExit("calloc"); |
48 | memset(paths, 0, path_cnt * sizeof(char *)); // get rid of false positive error from GCC static analyzer | ||
48 | 49 | ||
49 | // fill in 'paths' with pointers to elements of 'path' | 50 | // fill in 'paths' with pointers to elements of 'path' |
50 | unsigned int i = 0, j; | 51 | unsigned int i = 0, j; |
diff --git a/src/firejail/sbox.c b/src/firejail/sbox.c index a92d62940..a2aaa86eb 100644 --- a/src/firejail/sbox.c +++ b/src/firejail/sbox.c | |||
@@ -263,6 +263,7 @@ int sbox_run(unsigned filtermask, int num, ...) { | |||
263 | 263 | ||
264 | int sbox_run_v(unsigned filtermask, char * const arg[]) { | 264 | int sbox_run_v(unsigned filtermask, char * const arg[]) { |
265 | EUID_ROOT(); | 265 | EUID_ROOT(); |
266 | assert(arg); | ||
266 | 267 | ||
267 | if (arg_debug) { | 268 | if (arg_debug) { |
268 | printf("sbox run: "); | 269 | printf("sbox run: "); |
@@ -288,7 +289,7 @@ int sbox_run_v(unsigned filtermask, char * const arg[]) { | |||
288 | if (waitpid(child, &status, 0) == -1 ) { | 289 | if (waitpid(child, &status, 0) == -1 ) { |
289 | errExit("waitpid"); | 290 | errExit("waitpid"); |
290 | } | 291 | } |
291 | if (WIFEXITED(status) && status != 0) { | 292 | if (WIFEXITED(status) && WEXITSTATUS(status) != 0) { |
292 | fprintf(stderr, "Error: failed to run %s\n", arg[0]); | 293 | fprintf(stderr, "Error: failed to run %s\n", arg[0]); |
293 | exit(1); | 294 | exit(1); |
294 | } | 295 | } |