D_AutoloadFile: add overflow safeguard

This commit is contained in:
alufolie91 committed 2026-03-01 01:04:14 +01:00
1 parent 5ca3ab5966
commit e8c7cc6a9b
1 file changed
+6
+6
View File
@@ -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);