mirror of
https://github.com/troglobit/finit.git
synced 2026-10-31 13:00:32 +00:00
Check stat() return value, found by Coverity Scan
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
22192acce4
commit
03a33fc0ee
1 file changed
+4
-1
+4
-1
@@ -479,6 +479,7 @@ int conf_reload_dynamic(void)
|
|||||||
|
|
||||||
/* Check that it's an actual file ... beyond any symlinks */
|
/* Check that it's an actual file ... beyond any symlinks */
|
||||||
if (lstat(path, &st)) {
|
if (lstat(path, &st)) {
|
||||||
|
lost:
|
||||||
_d("Skipping %s, cannot access: %s", path, strerror(errno));
|
_d("Skipping %s, cannot access: %s", path, strerror(errno));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -513,7 +514,9 @@ int conf_reload_dynamic(void)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
stat(path, &st);
|
if (stat(path, &st))
|
||||||
|
goto lost; /* Weird, lost file between here and lstat() */
|
||||||
|
|
||||||
TIMESPEC_TO_TIMEVAL(&mtime, &st.st_mtim);
|
TIMESPEC_TO_TIMEVAL(&mtime, &st.st_mtim);
|
||||||
parse_conf_dynamic(path, &mtime);
|
parse_conf_dynamic(path, &mtime);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user