l10ntools/source/lngmerge.cxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
New commits: commit f558eb09dc4f1707313f09118b8574e405c64beb Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Mon Oct 21 17:21:02 2024 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Tue Oct 22 12:43:28 2024 +0200 tdf#163486: PVS: check stream read instead of EOF V1024 The 'aStream' stream is checked for EOF before reading from it, but is not checked after reading. Potential use of invalid data. Change-Id: I4f7b10bc896d13a31a97ed0dbacd413de990eb89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175363 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/l10ntools/source/lngmerge.cxx b/l10ntools/source/lngmerge.cxx index 7d3587e68067..9a1b172a0981 100644 --- a/l10ntools/source/lngmerge.cxx +++ b/l10ntools/source/lngmerge.cxx @@ -67,8 +67,7 @@ LngParser::LngParser(OString sLngFile) bool bFirstLine = true; std::string s; - std::getline(aStream, s); - while (!aStream.eof()) + while (std::getline(aStream, s)) { OString sLine(s.data(), s.length()); @@ -80,7 +79,6 @@ LngParser::LngParser(OString sLngFile) } mvLines.push_back( sLine ); - std::getline(aStream, s); } mvLines.push_back( OString() ); }