Skip to content

Commit

Permalink
_rc_deptree_load - return NULL if the stat() call is not successful
Browse files Browse the repository at this point in the history
X-Gentoo-Bug: 643084
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=643084
  • Loading branch information
williamh committed Jan 16, 2018
1 parent fee2ffe commit 4af5a80
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/rc/rc-misc.c
Expand Up @@ -380,7 +380,10 @@ RC_DEPTREE * _rc_deptree_load(int force, int *regen)
eend (retval, "Failed to update the dependency tree");

if (retval == 0) {
stat(RC_DEPTREE_CACHE, &st);
if (stat(RC_DEPTREE_CACHE, &st) != 0) {
eerror("stat(%s): %s", RC_DEPTREE_CACHE, strerror(errno));
return NULL;
}
if (st.st_mtime < t) {
eerror("Clock skew detected with `%s'", file);
eerrorn("Adjusting mtime of `" RC_DEPTREE_CACHE
Expand Down

0 comments on commit 4af5a80

Please sign in to comment.