summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tlillqvist@novell.com>2011-01-14 12:23:56 +0200
committerTor Lillqvist <tml@hemulen.(none)>2011-01-14 12:53:39 +0200
commit4f81b94b7cee00c88e31612dc26800199c570ba6 (patch)
tree608850099ff02a70f239675bc04beaa92ca051de
parentc13ec5fbad1bbdc5a40a70b3d0b4ca86c01708fb (diff)
Be slightly more paranoid defensive
(cherry picked from commit f8bfab1f464d0f26accb6d28b31b4749306bbfda) Signed-off-by: Thorsten Behrens <thb@documentfoundation.org>
-rw-r--r--desktop/win32/source/setup/setup.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/desktop/win32/source/setup/setup.cpp b/desktop/win32/source/setup/setup.cpp
index 17466960b6..69d09a47f6 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" ) );