diff options
-rw-r--r-- | src/firejail/env.c | 2 | ||||
-rw-r--r-- | src/firejail/fs.c | 1 | ||||
-rw-r--r-- | src/firejail/fs_dev.c | 1 | ||||
-rw-r--r-- | src/firejail/fs_var.c | 1 |
4 files changed, 5 insertions, 0 deletions
diff --git a/src/firejail/env.c b/src/firejail/env.c index 2bbd2d226..99922aac3 100644 --- a/src/firejail/env.c +++ b/src/firejail/env.c | |||
@@ -47,6 +47,7 @@ void env_ibus_load(void) { | |||
47 | return; | 47 | return; |
48 | 48 | ||
49 | // find the file | 49 | // find the file |
50 | /* coverity[toctou] */ | ||
50 | DIR *dir = opendir(dirname); | 51 | DIR *dir = opendir(dirname); |
51 | if (!dir) { | 52 | if (!dir) { |
52 | free(dirname); | 53 | free(dirname); |
@@ -92,6 +93,7 @@ void env_ibus_load(void) { | |||
92 | } | 93 | } |
93 | 94 | ||
94 | free(dirname); | 95 | free(dirname); |
96 | closedir(dir); | ||
95 | } | 97 | } |
96 | 98 | ||
97 | 99 | ||
diff --git a/src/firejail/fs.c b/src/firejail/fs.c index 42d31f567..ca44a2d5d 100644 --- a/src/firejail/fs.c +++ b/src/firejail/fs.c | |||
@@ -102,6 +102,7 @@ void fs_build_cp_command(void) { | |||
102 | fprintf(stderr, "Error: cannot access /bin/cp\n"); | 102 | fprintf(stderr, "Error: cannot access /bin/cp\n"); |
103 | exit(1); | 103 | exit(1); |
104 | } | 104 | } |
105 | /* coverity[toctou] */ | ||
105 | if (chmod(CP_COMMAND, 0755)) | 106 | if (chmod(CP_COMMAND, 0755)) |
106 | errExit("chmod"); | 107 | errExit("chmod"); |
107 | 108 | ||
diff --git a/src/firejail/fs_dev.c b/src/firejail/fs_dev.c index ee67a5696..ec7126ffd 100644 --- a/src/firejail/fs_dev.c +++ b/src/firejail/fs_dev.c | |||
@@ -96,6 +96,7 @@ void fs_private_dev(void){ | |||
96 | 96 | ||
97 | // bring back the /dev/dri directory | 97 | // bring back the /dev/dri directory |
98 | if (have_dri) { | 98 | if (have_dri) { |
99 | /* coverity[toctou] */ | ||
99 | rv = mkdir("/dev/dri", 0755); | 100 | rv = mkdir("/dev/dri", 0755); |
100 | if (rv == -1) | 101 | if (rv == -1) |
101 | errExit("mkdir"); | 102 | errExit("mkdir"); |
diff --git a/src/firejail/fs_var.c b/src/firejail/fs_var.c index 7e822f614..c6f989266 100644 --- a/src/firejail/fs_var.c +++ b/src/firejail/fs_var.c | |||
@@ -318,6 +318,7 @@ void fs_var_utmp(void) { | |||
318 | if (arg_debug) | 318 | if (arg_debug) |
319 | printf("Create the new utmp file\n"); | 319 | printf("Create the new utmp file\n"); |
320 | 320 | ||
321 | /* coverity[toctou] */ | ||
321 | FILE *fp = fopen(UTMP_FILE, "w"); | 322 | FILE *fp = fopen(UTMP_FILE, "w"); |
322 | if (!fp) | 323 | if (!fp) |
323 | errExit("fopen"); | 324 | errExit("fopen"); |