CL_DemoFilename : Fixed crash due to buffer overflow bug.

fileName arg points to a buffer of size MAX_QPATH. Original code used MAX_OSPATH instead.
This commit is contained in:
Artem Kharytoniuk
2017-05-10 19:58:42 +03:00
parent a99e89ce40
commit ff38799381

View File

@@ -227,7 +227,7 @@ void CL_DemoFilename( int number, char *fileName ) {
int a,b,c,d;
if ( number < 0 || number > 9999 ) {
Com_sprintf( fileName, MAX_OSPATH, "demo9999.tga" );
Com_sprintf( fileName, MAX_QPATH, "demo9999.tga" );
return;
}
@@ -239,7 +239,7 @@ void CL_DemoFilename( int number, char *fileName ) {
number -= c*10;
d = number;
Com_sprintf( fileName, MAX_OSPATH, "demo%i%i%i%i"
Com_sprintf( fileName, MAX_QPATH, "demo%i%i%i%i"
, a, b, c, d );
}