Browse Source

Fix potential crash / data corruption in hud message

hltopdown
Roman Chistokhodov 6 years ago committed by Alibek Omarov
parent
commit
ea6fa67c87
  1. 3
      cl_dll/message.cpp

3
cl_dll/message.cpp

@ -281,9 +281,12 @@ void CHudMessage::MessageDrawScan( client_textmessage_t *pMessage, float time ) @@ -281,9 +281,12 @@ void CHudMessage::MessageDrawScan( client_textmessage_t *pMessage, float time )
while( *pText && *pText != '\n' )
{
unsigned char c = *pText;
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…
Cancel
Save