commit d6d412c49e47027a38698d906f6ad853c8674582
Author: Jean-Marc Lasgouttes <[email protected]>
Date: Sat Mar 11 20:46:32 2017 +0100
Limit the size of strings we read from RCS
This calms down Coverity which fears than an evil RCS repository would
break LyX.
---
src/VCBackend.cpp | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/VCBackend.cpp b/src/VCBackend.cpp
index b395a0d..3eeb3d6 100644
--- a/src/VCBackend.cpp
+++ b/src/VCBackend.cpp
@@ -170,6 +170,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;