aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2015-11-29 11:48:01 -0500
committerLibravatar netblue30 <netblue30@yahoo.com>2015-11-29 11:48:01 -0500
commit86fee02127da3cf048baecee8c981e346eaedfae (patch)
tree66712d1a1784edf278735b32cccf3a8e8b1004cc /src
parentdisable firejail configuration based on (diff)
downloadfirejail-86fee02127da3cf048baecee8c981e346eaedfae.tar.gz
firejail-86fee02127da3cf048baecee8c981e346eaedfae.tar.zst
firejail-86fee02127da3cf048baecee8c981e346eaedfae.zip
coverity scan
Diffstat (limited to 'src')
-rw-r--r--src/firejail/fs_logger.c1
-rw-r--r--src/firejail/fs_whitelist.c3
-rw-r--r--src/firejail/restrict_users.c2
3 files changed, 6 insertions, 0 deletions
diff --git a/src/firejail/fs_logger.c b/src/firejail/fs_logger.c
index 4bf24e749..f735b1489 100644
--- a/src/firejail/fs_logger.c
+++ b/src/firejail/fs_logger.c
@@ -163,6 +163,7 @@ void fs_logger_print_log(pid_t pid) {
163 exit(1); 163 exit(1);
164 } 164 }
165 165
166 /* coverity[toctou] */
166 FILE *fp = fopen(fname, "r"); 167 FILE *fp = fopen(fname, "r");
167 if (!fp) { 168 if (!fp) {
168 printf("Cannot open filesystem log.\n"); 169 printf("Cannot open filesystem log.\n");
diff --git a/src/firejail/fs_whitelist.c b/src/firejail/fs_whitelist.c
index f8cce219e..e0187981b 100644
--- a/src/firejail/fs_whitelist.c
+++ b/src/firejail/fs_whitelist.c
@@ -582,6 +582,9 @@ void fs_whitelist(void) {
582 errExit("mount tmpfs"); 582 errExit("mount tmpfs");
583 } 583 }
584 584
585 if (new_name)
586 free(new_name);
587
585 return; 588 return;
586 589
587errexit: 590errexit:
diff --git a/src/firejail/restrict_users.c b/src/firejail/restrict_users.c
index ec65005ba..1b4058987 100644
--- a/src/firejail/restrict_users.c
+++ b/src/firejail/restrict_users.c
@@ -121,6 +121,7 @@ static void sanitize_passwd(void) {
121 fs_build_mnt_dir(); 121 fs_build_mnt_dir();
122 122
123 // open files 123 // open files
124 /* coverity[toctou] */
124 fpin = fopen("/etc/passwd", "r"); 125 fpin = fopen("/etc/passwd", "r");
125 if (!fpin) 126 if (!fpin)
126 goto errout; 127 goto errout;
@@ -253,6 +254,7 @@ static void sanitize_group(void) {
253 fs_build_mnt_dir(); 254 fs_build_mnt_dir();
254 255
255 // open files 256 // open files
257 /* coverity[toctou] */
256 fpin = fopen("/etc/group", "r"); 258 fpin = fopen("/etc/group", "r");
257 if (!fpin) 259 if (!fpin)
258 goto errout; 260 goto errout;