mirror of
https://github.com/wolfcw/libfaketime.git
synced 2026-05-17 08:36:28 +03:00
fake_clock_gettime: avoid placing large buffers on the stack
This commit is contained in:
@@ -2770,8 +2770,8 @@ int fake_clock_gettime(clockid_t clk_id, struct timespec *tp)
|
||||
/* fake time supplied as environment variable? */
|
||||
if (parse_config_file)
|
||||
{
|
||||
char custom_filename[BUFSIZ];
|
||||
char filename[BUFSIZ];
|
||||
static char custom_filename[BUFSIZ];
|
||||
static char filename[BUFSIZ];
|
||||
FILE *faketimerc;
|
||||
/* check whether there's a .faketimerc in the user's home directory, or
|
||||
* a system-wide /etc/faketimerc present.
|
||||
@@ -2783,7 +2783,7 @@ int fake_clock_gettime(clockid_t clk_id, struct timespec *tp)
|
||||
(faketimerc = fopen(filename, "rt")) != NULL ||
|
||||
(faketimerc = fopen("/etc/faketimerc", "rt")) != NULL)
|
||||
{
|
||||
char line[BUFFERLEN];
|
||||
static char line[BUFFERLEN];
|
||||
while(fgets(line, BUFFERLEN, faketimerc) != NULL)
|
||||
{
|
||||
if ((strlen(line) > 1) && (line[0] != ' ') &&
|
||||
|
||||
Reference in New Issue
Block a user