Mark a number of coverity false positives.

Fixes coverity #23284, 23285, 23286, 23287, 23289.
This commit is contained in:
Richard Heck 2016-06-11 22:38:57 -04:00
parent 2db62cf5d5
commit 355395174b
5 changed files with 10 additions and 0 deletions

View File

@ -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);
}

View File

@ -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;

View File

@ -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

View File

@ -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\": "

View File

@ -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);