X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FVCBackend.cpp;h=a152a28d101e11f209f202243f6c0b011a91d2f3;hb=a550f7d91e2f945517cf96ad5f68788944539ecb;hp=b395a0d2b210563cabfb2ef518b6d7a168f1688d;hpb=0cb85e920666e8a47cb74ce96711fdcae8168862;p=lyx.git diff --git a/src/VCBackend.cpp b/src/VCBackend.cpp index b395a0d2b2..a152a28d10 100644 --- a/src/VCBackend.cpp +++ b/src/VCBackend.cpp @@ -31,6 +31,7 @@ #include "support/TempFile.h" #include +#include #include using namespace std; @@ -170,6 +171,8 @@ void RCS::scanMaster() LYXERR(Debug::LYXVC, "LyXVC::RCS: scanMaster: " << master_); ifstream ifs(master_.toFilesystemEncoding().c_str()); + // limit the size of strings we read to avoid memory problems + ifs >> setw(65636); string token; bool read_enough = false; @@ -566,10 +569,10 @@ void CVS::scanMaster() if (contains(line, tmpf)) { // Ok extract the fields. smatch sm; - - // false positive from coverity - // coverity[CHECKED_RETURN] - regex_match(line, sm, reg); + if (!regex_match(line, sm, reg)) { + LYXERR(Debug::LYXVC, "\t Cannot parse line. Skipping."); + continue; + } //sm[0]; // whole matched string //sm[1]; // filename