D_AutoloadFile: add overflow safeguard
This commit is contained in:
1 parent
2dff538ee5
commit
e30a87b4fc
1 file changed
+6
@@ -1152,6 +1152,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