Fix potential OOB in Windows Dedicated TTY CON_Show

Found by Coverity.
This commit is contained in:
Zack Middleton 2014-05-26 23:11:56 -05:00
parent 077ab4cbd1
commit 347b429fdb

View file

@ -208,7 +208,7 @@ static void CON_Show( void )
{ {
if( i < qconsole_linelen ) if( i < qconsole_linelen )
{ {
if( Q_IsColorString( qconsole_line + i ) ) if( i + 1 < qconsole_linelen && Q_IsColorString( qconsole_line + i ) )
attrib = CON_ColorCharToAttrib( *( qconsole_line + i + 1 ) ); attrib = CON_ColorCharToAttrib( *( qconsole_line + i + 1 ) );
line[ i ].Char.AsciiChar = qconsole_line[ i ]; line[ i ].Char.AsciiChar = qconsole_line[ i ];