[Libreoffice-commits] .: desktop/win32

Tor Lillqvist tml at kemper.freedesktop.org
Fri Jan 14 02:29:40 PST 2011


 desktop/win32/source/setup/setup.cpp |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit f8bfab1f464d0f26accb6d28b31b4749306bbfda
Author: Tor Lillqvist <tlillqvist at novell.com>
Date:   Fri Jan 14 12:23:56 2011 +0200

    Be slightly more paranoid defensive

diff --git a/desktop/win32/source/setup/setup.cpp b/desktop/win32/source/setup/setup.cpp
index 1746696..69d09a4 100644
--- a/desktop/win32/source/setup/setup.cpp
+++ b/desktop/win32/source/setup/setup.cpp
@@ -271,7 +271,7 @@ boolean SetupAppX::GetProfileSection( LPCTSTR pFileName, LPCTSTR pSection,
 
     DWORD nRet = GetPrivateProfileSection( pSection, *pRetBuf, rSize, pFileName );
 
-    while ( nRet && ( nRet + 2 == rSize ) ) // buffer was too small, retry until big enough
+    while ( nRet && ( nRet + 2 >= rSize ) ) // buffer was too small, retry until big enough
     {
         if (rSize > 1000000)
             break;
@@ -291,7 +291,7 @@ boolean SetupAppX::GetProfileSection( LPCTSTR pFileName, LPCTSTR pSection,
         Log( sBuf );
         return false;
     }
-    else if ( nRet + 2 == rSize )
+    else if ( nRet + 2 >= rSize )
     {
         SetError( ERROR_OUTOFMEMORY );
         Log( TEXT( "ERROR: GetPrivateProfileSection() out of memory\r\n" ) );


More information about the Libreoffice-commits mailing list