aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gentoo.org>2022-01-24 11:31:37 -0800
committerWilliam Hubbs <w.d.hubbs@gmail.com>2022-01-26 20:18:23 -0600
commite6d48ea1417b7ddab0f16297b6f595ad161e0a80 (patch)
treed7625cbe74c7bff071f322e73b93a14a1c65ad09
parent0f8fe2a6cb9aec1d02a304224d0659968f8cad1e (diff)
rc-misc.c: Allocate memory for 'file'
This is a partial revert of commit 8e02406d ("rc-misc.c: remove references to PATH_MAX"), which changed 'file' to a null pointer with no associated storage. ../openrc-0.44.10/src/rc/rc-misc.c: In function ‘_rc_deptree_load’: ../openrc-0.44.10/src/rc/rc-misc.c:392:33: warning: ‘%s’ directive argument is null [-Wformat-overflow=] 392 | eerror("Clock skew detected with `%s'", file); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fixes: 8e02406d ("rc-misc.c: remove references to PATH_MAX") Closes: #493
-rw-r--r--src/rc/rc-misc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rc/rc-misc.c b/src/rc/rc-misc.c
index 99a60fe4..1ca51e72 100644
--- a/src/rc/rc-misc.c
+++ b/src/rc/rc-misc.c
@@ -362,7 +362,7 @@ RC_DEPTREE * _rc_deptree_load(int force, int *regen)
int serrno = errno;
int merrno;
time_t t;
- char *file = NULL;
+ char file[PATH_MAX];
struct stat st;
struct utimbuf ut;
FILE *fp;