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;