mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-01-14 08:57:52 +00:00
Fix potential crash / data corruption in hud message
This commit is contained in:
parent
86229f7926
commit
ea6fa67c87
@ -281,9 +281,12 @@ void CHudMessage::MessageDrawScan( client_textmessage_t *pMessage, float time )
|
||||
while( *pText && *pText != '\n' )
|
||||
{
|
||||
unsigned char c = *pText;
|
||||
line[m_parms.lineLength] = c;
|
||||
m_parms.width += gHUD.m_scrinfo.charWidths[c];
|
||||
m_parms.lineLength++;
|
||||
if (m_parms.lineLength < sizeof(line)-1)
|
||||
{
|
||||
line[m_parms.lineLength] = c;
|
||||
m_parms.width += gHUD.m_scrinfo.charWidths[c];
|
||||
m_parms.lineLength++;
|
||||
}
|
||||
pText++;
|
||||
}
|
||||
pText++; // Skip LF
|
||||
|
Loading…
Reference in New Issue
Block a user