From 355395174bf50e1a3b8514e8eebec978c496d6ba Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Sat, 11 Jun 2016 22:38:57 -0400 Subject: [PATCH] Mark a number of coverity false positives. Fixes coverity #23284, 23285, 23286, 23287, 23289. --- src/Length.cpp | 2 ++ src/TextClass.cpp | 2 ++ src/VCBackend.cpp | 2 ++ src/insets/ExternalTransforms.cpp | 2 ++ src/lyxfind.cpp | 2 ++ 5 files changed, 10 insertions(+) diff --git a/src/Length.cpp b/src/Length.cpp index d862f40213..a55d2ef8be 100644 --- a/src/Length.cpp +++ b/src/Length.cpp @@ -355,6 +355,8 @@ GlueLength::GlueLength(Length const & len, Length const & plus, GlueLength::GlueLength(string const & data) { + // false positive from coverity + // coverity[CHECKED_RETURN] isValidGlueLength(data, this); } diff --git a/src/TextClass.cpp b/src/TextClass.cpp index e1e40272ea..b282ba3802 100644 --- a/src/TextClass.cpp +++ b/src/TextClass.cpp @@ -528,6 +528,8 @@ TextClass::ReturnValues TextClass::read(Lexer & lexrc, ReadType rt) // Either way, we just scan the rest and discard it else { Layout lay; + // false positive from coverity + // coverity[CHECKED_RETURN] readStyle(lexrc, lay); } break; diff --git a/src/VCBackend.cpp b/src/VCBackend.cpp index e0d9b4cce4..fbe367b5f0 100644 --- a/src/VCBackend.cpp +++ b/src/VCBackend.cpp @@ -566,6 +566,8 @@ void CVS::scanMaster() // Ok extract the fields. smatch sm; + // false positive from coverity + // coverity[CHECKED_RETURN] regex_match(line, sm, reg); //sm[0]; // whole matched string diff --git a/src/insets/ExternalTransforms.cpp b/src/insets/ExternalTransforms.cpp index a3bf82df65..ee31e1911f 100644 --- a/src/insets/ExternalTransforms.cpp +++ b/src/insets/ExternalTransforms.cpp @@ -310,6 +310,8 @@ string const sanitizeLatexOption(string const & input) // Strip any trailing commas // "...foo,,,]" -> "...foo" ("...foo,,," may be empty) static lyx::regex const back("^(.*[^,])?,*\\] *$"); + // false positive from coverity + // coverity[CHECKED_RETURN] regex_match(output, what, back); if (!what[0].matched) { lyxerr << "Unable to sanitize LaTeX \"Option\": " diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp index d7038dedcb..69a9b80883 100644 --- a/src/lyxfind.cpp +++ b/src/lyxfind.cpp @@ -1408,6 +1408,8 @@ static void findAdvReplace(BufferView * bv, FindAndReplaceOptions const & opt, M docstring repl_latex = ods.str(); LYXERR(Debug::FIND, "Latexified replace_buffer: '" << repl_latex << "'"); string s; + // false positive from coverity + // coverity[CHECKED_RETURN] regex_replace(to_utf8(repl_latex), s, "\\$(.*)\\$", "$1"); regex_replace(s, s, "\\\\\\[(.*)\\\\\\]", "$1"); repl_latex = from_utf8(s); -- 2.39.2