Suppress a Coverity taint warning in check_status_file()
authorBart Van Assche <bvanassche@acm.org>
Tue, 31 Dec 2019 17:35:10 +0000 (09:35 -0800)
committerBart Van Assche <bvanassche@acm.org>
Wed, 1 Jan 2020 17:24:45 +0000 (09:24 -0800)
Suppress the following Coverity complaint:

CID 24143 (#1 of 1): Use of untrusted string value (TAINTED_STRING)
tainted_string: Passing tainted string fio_status_file_path to unlink, which
cannot accept tainted data.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
stat.c

diff --git a/stat.c b/stat.c
index 05663e07b4379f7850a022b82ae96c19041cd27f..e2bc8ddb5fa4a554cd45b7c2ff9f0fd16f00e91d 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -2123,6 +2123,9 @@ static int check_status_file(void)
        }
        if (temp_dir == NULL)
                temp_dir = "/tmp";
+#ifdef __COVERITY__
+       __coverity_tainted_data_sanitize__(temp_dir);
+#endif
 
        snprintf(fio_status_file_path, sizeof(fio_status_file_path), "%s/%s", temp_dir, FIO_STATUS_FILE);