diff options
author | Matt Turner <mattst88@gentoo.org> | 2022-01-24 11:31:37 -0800 |
---|---|---|
committer | William Hubbs <w.d.hubbs@gmail.com> | 2022-01-26 20:18:23 -0600 |
commit | e6d48ea1417b7ddab0f16297b6f595ad161e0a80 (patch) | |
tree | d7625cbe74c7bff071f322e73b93a14a1c65ad09 /src | |
parent | 0f8fe2a6cb9aec1d02a304224d0659968f8cad1e (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
Diffstat (limited to 'src')
-rw-r--r-- | src/rc/rc-misc.c | 2 |
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; |