game: fix string vulnerabilities

This commit is contained in:
SanyaSho
2022-11-04 01:03:52 +00:00
parent ba90de20d9
commit e368f3e9a6
7 changed files with 23 additions and 23 deletions

View File

@@ -987,7 +987,7 @@ void CHudMessage::AddChar( int r, int g, int b, int a, wchar_t ch )
//-----------------------------------------------------------------------------
void CHudMessage::GetTextExtents( int *wide, int *tall, const char *string )
{
*wide = g_pMatSystemSurface->DrawTextLen( m_hFont, (char *)string );
*wide = g_pMatSystemSurface->DrawTextLen( m_hFont, "%s", (char *)string );
*tall = vgui::surface()->GetFontTall( m_hFont );
}
@@ -1067,4 +1067,4 @@ void CHudMessage::PaintCharacters()
void CHudMessage::GetLength( int *wide, int *tall, const char *string )
{
GetTextExtents( wide, tall, string );
}
}