engine: fix buffer overflow in COM_ParseFile

This commit is contained in:
Alibek Omarov 2019-07-26 17:24:09 +03:00
parent 0ce8d92f27
commit e308281b0b

View File

@ -510,8 +510,17 @@ skipwhite:
data++; data++;
while( 1 ) while( 1 )
{ {
c = (byte)*data++; c = (byte)*data;
if( c == '\"' || !c )
// unexpected line end
if( !c )
{
token[len] = 0;
return data;
}
data++;
if( c == '\"' )
{ {
token[len] = 0; token[len] = 0;
return data; return data;