aboutsummaryrefslogtreecommitdiff
path: root/src/rc
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2018-01-16 13:11:22 -0600
committerWilliam Hubbs <w.d.hubbs@gmail.com>2018-01-16 13:11:22 -0600
commit4af5a80b0c516773286cc30e743dc90a2d19df23 (patch)
treed9a957c58a3a042e8a12b6c2438c2bdf607bf4ad /src/rc
parentfee2ffe559bc39beec16585daf557b902a53137b (diff)
_rc_deptree_load - return NULL if the stat() call is not successful
X-Gentoo-Bug: 643084 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=643084
Diffstat (limited to 'src/rc')
-rw-r--r--src/rc/rc-misc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/rc/rc-misc.c b/src/rc/rc-misc.c
index 33a17b35..21c06fc5 100644
--- a/src/rc/rc-misc.c
+++ b/src/rc/rc-misc.c
@@ -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