From 410e65ce2f1e93a2fc062f97fb6c62f5917f36ff Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 19 Jul 2020 23:28:25 +0200 Subject: [PATCH] Coverity: Suppress false-positives --- src/Base/FileInfo.cpp | 1 + src/Base/Stream.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Base/FileInfo.cpp b/src/Base/FileInfo.cpp index 1e26aa051b..2f13e54b90 100644 --- a/src/Base/FileInfo.cpp +++ b/src/Base/FileInfo.cpp @@ -188,6 +188,7 @@ std::string FileInfo::getTempFileName(const char* FileName, const char* Path) buf += "/fileXXXXXX"; } + /* coverity[secure_temp] mkstemp uses 0600 as the mode and is safe */ int id = mkstemp(const_cast(buf.c_str())); if (id > -1) { FILE* file = fdopen(id, "w"); diff --git a/src/Base/Stream.cpp b/src/Base/Stream.cpp index 8568b65f0a..252d5d2a7d 100644 --- a/src/Base/Stream.cpp +++ b/src/Base/Stream.cpp @@ -783,6 +783,7 @@ Streambuf::int_type Streambuf::uflow() Streambuf::int_type Streambuf::pbackfail( int_type ch ) { + /* coverity[negative_returns] _cur is an iterator */ if (_cur == _beg || (ch != traits_type::eof() && ch != _cur[-1])) return traits_type::eof();