coverity scan

This commit is contained in:
netblue30 2015-11-29 11:48:01 -05:00
parent 23c1dcb284
commit 86fee02127
3 changed files with 6 additions and 0 deletions

View file

@ -163,6 +163,7 @@ void fs_logger_print_log(pid_t pid) {
exit(1);
}
/* coverity[toctou] */
FILE *fp = fopen(fname, "r");
if (!fp) {
printf("Cannot open filesystem log.\n");

View file

@ -582,6 +582,9 @@ void fs_whitelist(void) {
errExit("mount tmpfs");
}
if (new_name)
free(new_name);
return;
errexit:

View file

@ -121,6 +121,7 @@ static void sanitize_passwd(void) {
fs_build_mnt_dir();
// open files
/* coverity[toctou] */
fpin = fopen("/etc/passwd", "r");
if (!fpin)
goto errout;
@ -253,6 +254,7 @@ static void sanitize_group(void) {
fs_build_mnt_dir();
// open files
/* coverity[toctou] */
fpin = fopen("/etc/group", "r");
if (!fpin)
goto errout;