D_AutoloadFile: add overflow safeguard
This commit is contained in:
1 parent
5ca3ab5966
commit
e8c7cc6a9b
1 file changed
+6
@@ -1042,6 +1042,12 @@ static void D_AutoloadFile(const char *file, char **filearray, size_t *index)
|
||||
char *newfile;
|
||||
INT32 fileType = D_DetectFileType(file);
|
||||
|
||||
if (*index >= MAX_WADFILES)
|
||||
{
|
||||
CONS_Printf("D_AutoloadFile: Failed to add file %s! Too many autoloaded files\n", file);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!fileType)
|
||||
{
|
||||
CONS_Printf("D_AutoloadFile: File %s is unknown or invalid\n", file);
|
||||
|
||||
Reference in new issue
Block a user