engine: client: limit token size in client dll parsefile to 1024 (GoldSrc value)

This commit is contained in:
Alibek Omarov 2022-01-27 03:25:32 +03:00
parent 2fa964e939
commit 56103a90eb
2 changed files with 2 additions and 2 deletions

View File

@ -3089,7 +3089,7 @@ char *pfnParseFile( char *data, char *token )
{
char *out;
out = _COM_ParseFileSafe( data, token, INT_MAX, PFILE_HANDLECOLON, NULL );
out = _COM_ParseFileSafe( data, token, PFILE_TOKEN_MAX_LENGTH, PFILE_HANDLECOLON, NULL );
return out;
}

View File

@ -43,6 +43,7 @@ enum
// exported APIs headers and will get nice warning in case of changing values
#define PFILE_IGNOREBRACKET (1<<0)
#define PFILE_HANDLECOLON (1<<1)
#define PFILE_TOKEN_MAX_LENGTH 1024
//
// crtlib.c
@ -98,7 +99,6 @@ void COM_Hex2String( uint8_t hex, char *str );
#define COM_CheckStringEmpty( string ) ( ( !*string ) ? 0 : 1 )
char *_COM_ParseFileSafe( char *data, char *token, const int size, unsigned int flags, int *len );
#define COM_ParseFile( data, token, size ) _COM_ParseFileSafe( data, token, size, 0, NULL )
#define COM_ParseFileLegacy( data, token ) COM_ParseFileSafe( data, token, INT_MAX )
int matchpattern( const char *in, const char *pattern, qboolean caseinsensitive );
int matchpattern_with_separator( const char *in, const char *pattern, qboolean caseinsensitive, const char *separators, qboolean wildcard_least_one );