From edcc8e7ec9652465724ef09f0a46d80d12b0a6e0 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Mon, 28 Nov 2016 09:39:02 +0100 Subject: [PATCH] stat: suppress CID 1293508 and 1312013 --- src/conf-yaml-loader.c | 2 ++ src/log-tlsstore.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/conf-yaml-loader.c b/src/conf-yaml-loader.c index db53406966..6f40ab784e 100644 --- a/src/conf-yaml-loader.c +++ b/src/conf-yaml-loader.c @@ -475,6 +475,7 @@ ConfYamlLoadFileWithPrefix(const char *filename, const char *prefix) } struct stat stat_buf; + /* coverity[toctou] */ if (stat(filename, &stat_buf) == 0) { if (stat_buf.st_mode & S_IFDIR) { SCLogError(SC_ERR_FATAL, "yaml argument is not a file but a directory: %s. " @@ -483,6 +484,7 @@ ConfYamlLoadFileWithPrefix(const char *filename, const char *prefix) } } + /* coverity[toctou] */ infile = fopen(filename, "r"); if (infile == NULL) { SCLogError(SC_ERR_FATAL, "failed to open file: %s: %s", filename, diff --git a/src/log-tlsstore.c b/src/log-tlsstore.c index ddabd41fa3..6648f592aa 100644 --- a/src/log-tlsstore.c +++ b/src/log-tlsstore.c @@ -307,8 +307,10 @@ static TmEcode LogTlsStoreLogThreadInit(ThreadVars *t, void *initdata, void **da } struct stat stat_buf; + /* coverity[toctou] */ if (stat(tls_logfile_base_dir, &stat_buf) != 0) { int ret; + /* coverity[toctou] */ ret = mkdir(tls_logfile_base_dir, S_IRWXU|S_IXGRP|S_IRGRP); if (ret != 0) { int err = errno;