Correct pointless and bad buffer sizing in RegisterApplicationRestart
This commit is contained in:
parent
29632e8b6f
commit
06a515339c
|
@ -30,13 +30,15 @@
|
||||||
|
|
||||||
bool KIPLATFORM::APP::RegisterApplicationRestart( const wxString& aCommandLine )
|
bool KIPLATFORM::APP::RegisterApplicationRestart( const wxString& aCommandLine )
|
||||||
{
|
{
|
||||||
HRESULT hr = S_OK; // not if registering for recovery and restart fails.
|
// Ensure we don't exceed the maximum allowable size
|
||||||
WCHAR wsCommandLine[RESTART_MAX_CMD_LINE];
|
if( aCommandLine.length() > RESTART_MAX_CMD_LINE - 1 )
|
||||||
RtlZeroMemory( wsCommandLine, sizeof( wsCommandLine ) );
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
StringCchCopyW( wsCommandLine, sizeof( wsCommandLine ), aCommandLine.wc_str() );
|
HRESULT hr = S_OK;
|
||||||
|
|
||||||
hr = ::RegisterApplicationRestart( wsCommandLine, RESTART_NO_PATCH );
|
hr = ::RegisterApplicationRestart( aCommandLine.wc_str(), RESTART_NO_PATCH );
|
||||||
|
|
||||||
return SUCCEEDED( hr );
|
return SUCCEEDED( hr );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue