Merge pull request #394 from lioncash/bounds
Fix some array bounds-related errors
This commit is contained in:
commit
6426b76bfc
|
@ -208,10 +208,10 @@ void CMemoryLabel::ProcessCODFile(BYTE * File, DWORD FileLen)
|
|||
}
|
||||
}
|
||||
|
||||
if (Length > 40)
|
||||
{
|
||||
Length = 40;
|
||||
}
|
||||
// Stay within label array bounds
|
||||
if (Length > 39)
|
||||
Length = 39;
|
||||
|
||||
memcpy(Label,CurrentPos,Length);
|
||||
Label[Length] = '\0';
|
||||
|
||||
|
|
|
@ -147,9 +147,11 @@ void CNotification::SetGfxPlugin( CGfxPlugin * Plugin )
|
|||
|
||||
void CNotification::SetWindowCaption (const wchar_t * Caption)
|
||||
{
|
||||
wchar_t WinTitle[256];
|
||||
_snwprintf( WinTitle, sizeof(WinTitle), L"%s - %s", Caption, g_Settings->LoadString(Setting_ApplicationName).ToUTF16().c_str());
|
||||
WinTitle[sizeof(WinTitle) - 1] = 0;
|
||||
static const size_t TITLE_SIZE = 256;
|
||||
|
||||
wchar_t WinTitle[TITLE_SIZE];
|
||||
_snwprintf(WinTitle, TITLE_SIZE, L"%s - %s", Caption, g_Settings->LoadString(Setting_ApplicationName).ToUTF16().c_str());
|
||||
WinTitle[TITLE_SIZE - 1] = 0;
|
||||
m_hWnd->Caption(WinTitle);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue