stat: suppress CID 1293508 and 1312013

pull/2432/head
Victor Julien 10 years ago
parent 7021959689
commit edcc8e7ec9

@ -475,6 +475,7 @@ ConfYamlLoadFileWithPrefix(const char *filename, const char *prefix)
} }
struct stat stat_buf; struct stat stat_buf;
/* coverity[toctou] */
if (stat(filename, &stat_buf) == 0) { if (stat(filename, &stat_buf) == 0) {
if (stat_buf.st_mode & S_IFDIR) { if (stat_buf.st_mode & S_IFDIR) {
SCLogError(SC_ERR_FATAL, "yaml argument is not a file but a directory: %s. " 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"); infile = fopen(filename, "r");
if (infile == NULL) { if (infile == NULL) {
SCLogError(SC_ERR_FATAL, "failed to open file: %s: %s", filename, SCLogError(SC_ERR_FATAL, "failed to open file: %s: %s", filename,

@ -307,8 +307,10 @@ static TmEcode LogTlsStoreLogThreadInit(ThreadVars *t, void *initdata, void **da
} }
struct stat stat_buf; struct stat stat_buf;
/* coverity[toctou] */
if (stat(tls_logfile_base_dir, &stat_buf) != 0) { if (stat(tls_logfile_base_dir, &stat_buf) != 0) {
int ret; int ret;
/* coverity[toctou] */
ret = mkdir(tls_logfile_base_dir, S_IRWXU|S_IXGRP|S_IRGRP); ret = mkdir(tls_logfile_base_dir, S_IRWXU|S_IXGRP|S_IRGRP);
if (ret != 0) { if (ret != 0) {
int err = errno; int err = errno;

Loading…
Cancel
Save