D_AutoloadFile: add overflow safeguard

This commit is contained in:
alufolie91 committed 2026-03-01 13:48:26 +01:00
1 parent 2dff538ee5
commit e30a87b4fc
1 file changed
+6
+6
View File
@@ -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);