l10ntools/source/propmerge.cxx |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit b20877920ef11ff6682e4884da52892c6a31d7ff
Author:     Xisco Fauli <[email protected]>
AuthorDate: Wed Oct 23 13:09:50 2024 +0200
Commit:     Xisco Fauli <[email protected]>
CommitDate: Wed Oct 23 16:57:07 2024 +0200

    tdf#163486: PVS: check stream read instead of EOF
    
    V1024   The 'aIfstream' stream is checked for EOF before reading from it, 
but is not checked after reading. Potential use of invalid data.
    
    Change-Id: I253513c47ec1482882bbfb1c6e32e25c15ace99c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175475
    Reviewed-by: Xisco Fauli <[email protected]>
    Tested-by: Jenkins

diff --git a/l10ntools/source/propmerge.cxx b/l10ntools/source/propmerge.cxx
index e17b2dd9c153..d3b6314ba0af 100644
--- a/l10ntools/source/propmerge.cxx
+++ b/l10ntools/source/propmerge.cxx
@@ -99,8 +99,7 @@ PropParser::PropParser(
     if( aIfstream.is_open() )
     {
         std::string s;
-        std::getline( aIfstream, s );
-        while( !aIfstream.eof() )
+        while( std::getline( aIfstream, s ) )
         {
             OString sLine( s.data(), s.length() );
             if( bMergeMode ||
@@ -108,7 +107,6 @@ PropParser::PropParser(
             {
                 m_vLines.push_back( sLine );
             }
-            std::getline( aIfstream, s );
         }
     }
     else

Reply via email to