From: Jens Axboe Date: Mon, 14 Apr 2014 14:23:23 +0000 (-0600) Subject: stat: check that TEMP environment variable is half-way sane X-Git-Tag: fio-2.1.9~63 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=48b16e2725249985c9f1841928eb08574c24d3cc stat: check that TEMP environment variable is half-way sane Signed-off-by: Jens Axboe --- diff --git a/stat.c b/stat.c index 509c6f02..5a553d00 100644 --- a/stat.c +++ b/stat.c @@ -1494,8 +1494,11 @@ static int check_status_file(void) return 0; temp_dir = getenv("TMPDIR"); - if (temp_dir == NULL) + if (temp_dir == NULL) { temp_dir = getenv("TEMP"); + if (temp_dir && strlen(temp_dir) >= PATH_MAX) + temp_dir = NULL; + } if (temp_dir == NULL) temp_dir = "/tmp";