Skip to content

Commit

Permalink
rc-misc.c: Allocate memory for 'file'
Browse files Browse the repository at this point in the history
This is a partial revert of commit 8e02406 ("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: 8e02406 ("rc-misc.c: remove references to PATH_MAX")
Closes: #493
  • Loading branch information
mattst88 authored and williamh committed Jan 27, 2022
1 parent 0f8fe2a commit e6d48ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rc/rc-misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e6d48ea

Please sign in to comment.