l10ntools/source/helpex.cxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
New commits: commit 95feb2877e5dbe9549b9aabe049c1c7a81e4dc23 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Wed Oct 23 13:11:14 2024 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Wed Oct 23 15:30:55 2024 +0200 tdf#163486: PVS: check stream read instead of EOF V1024 The 'aInput' stream is checked for EOF before reading from it, but is not checked after reading. Potential use of invalid data. Change-Id: Ie0c6d1928dad804b21d3c9920cc1de8035ea0367 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175476 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> Tested-by: Jenkins diff --git a/l10ntools/source/helpex.cxx b/l10ntools/source/helpex.cxx index 97e574fc7dde..a5406d9b9c71 100644 --- a/l10ntools/source/helpex.cxx +++ b/l10ntools/source/helpex.cxx @@ -84,8 +84,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) pMergeDataFile.reset(new MergeDataFile(aArgs.m_sMergeSrc, "", false, false )); } std::string sTemp; - aInput >> sTemp; - while( !aInput.eof() ) + while ( aInput >> sTemp ) { // coverity[tainted_data] - this is a build time tool const OString sXhpFile( sTemp.data(), static_cast<sal_Int32>(sTemp.length()) ); @@ -98,7 +97,6 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) { hasNoError = false; } - aInput >> sTemp; } aInput.close(); }