Check regex_match result when parsing cvslog

Spotted by coverity.
This commit is contained in:
Jean-Marc Lasgouttes 2019-07-13 00:10:32 +02:00
parent c09a693d24
commit ca217fbfaa

View File

@ -734,12 +734,14 @@ void CVS::getRevisionInfo()
LYXERR(Debug::LYXVC, line << '\n');
if (prefixIs(line, "date:")) {
smatch sm;
regex_match(line, sm, reg);
//sm[0]; // whole matched string
rev_date_cache_ = sm[1];
rev_time_cache_ = sm[2];
//sm[3]; // GMT offset
rev_author_cache_ = sm[4];
if (regex_match(line, sm, reg)) {
//sm[0]; // whole matched string
rev_date_cache_ = sm[1];
rev_time_cache_ = sm[2];
//sm[3]; // GMT offset
rev_author_cache_ = sm[4];
} else
LYXERR(Debug::LYXVC, "\tCannot parse line. Skipping.");
break;
}
}