diff options
Diffstat (limited to 'setup_native')
3 files changed, 7 insertions, 0 deletions
diff --git a/setup_native/source/win32/customactions/regactivex/regactivex.cxx b/setup_native/source/win32/customactions/regactivex/regactivex.cxx index 293a8c8a4111..f7234a4725c8 100644 --- a/setup_native/source/win32/customactions/regactivex/regactivex.cxx +++ b/setup_native/source/win32/customactions/regactivex/regactivex.cxx @@ -23,6 +23,7 @@ #include <windows.h> #include <msiquery.h> +#include <cassert> #include <string.h> #include <malloc.h> @@ -66,6 +67,7 @@ static void RegisterActiveXNative( const wchar_t* pActiveXPath, int nMode, BOOL if ( nLen > nRemoveLen ) { wchar_t* pProgramPath = static_cast<wchar_t*>( malloc( (nLen - nRemoveLen + 1) * sizeof(wchar_t) ) ); + assert(pProgramPath); // Don't handle OOM conditions wcsncpy( pProgramPath, pActiveXPath, nLen - nRemoveLen ); pProgramPath[ nLen - nRemoveLen ] = 0; @@ -102,6 +104,7 @@ static BOOL GetMsiPropW( MSIHANDLE hMSI, const wchar_t* pPropName, wchar_t** ppV sz++; DWORD nbytes = sz * sizeof( wchar_t ); wchar_t* buff = static_cast<wchar_t*>( malloc( nbytes ) ); + assert(buff); // Don't handle OOM conditions ZeroMemory( buff, nbytes ); MsiGetPropertyW( hMSI, pPropName, buff, &sz ); *ppValue = buff; diff --git a/setup_native/source/win32/customactions/sellang/sellang.cxx b/setup_native/source/win32/customactions/sellang/sellang.cxx index bde31d03ab76..e82560f4239a 100644 --- a/setup_native/source/win32/customactions/sellang/sellang.cxx +++ b/setup_native/source/win32/customactions/sellang/sellang.cxx @@ -27,6 +27,7 @@ #include <msiquery.h> #include <malloc.h> +#include <cassert> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -44,6 +45,7 @@ static BOOL GetMsiPropA( MSIHANDLE hMSI, const char* pPropName, char** ppValue ) sz++; DWORD nbytes = sz * sizeof( char ); char* buff = static_cast<char*>( malloc( nbytes ) ); + assert(buff); // Don't handle OOM conditions ZeroMemory( buff, nbytes ); MsiGetPropertyA( hMSI, pPropName, buff, &sz ); *ppValue = buff; diff --git a/setup_native/source/win32/customactions/tools/checkversion.cxx b/setup_native/source/win32/customactions/tools/checkversion.cxx index ffb7a8aa4216..daf20963673b 100644 --- a/setup_native/source/win32/customactions/tools/checkversion.cxx +++ b/setup_native/source/win32/customactions/tools/checkversion.cxx @@ -21,6 +21,7 @@ #include <windows.h> #include <msiquery.h> +#include <cassert> #include <string.h> #include <malloc.h> #include <stdio.h> @@ -37,6 +38,7 @@ static BOOL GetMsiPropW( MSIHANDLE hMSI, const wchar_t* pPropName, wchar_t** ppV sz++; DWORD nbytes = sz * sizeof( wchar_t ); wchar_t* buff = static_cast<wchar_t*>( malloc( nbytes ) ); + assert(buff); // Don't handle OOM conditions ZeroMemory( buff, nbytes ); MsiGetPropertyW( hMSI, pPropName, buff, &sz ); *ppValue = buff; |