mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-02-22 20:01:21 +00:00
filesystem: check pak header record size
This commit is contained in:
parent
d1e23ae740
commit
98ebc126c2
1 changed files with 8 additions and 0 deletions
|
@ -975,6 +975,14 @@ FS_LoadPAK(const char *packPath)
|
|||
header.dirofs = LittleLong(header.dirofs);
|
||||
header.dirlen = LittleLong(header.dirlen);
|
||||
|
||||
if ((header.dirlen % sizeof(dpackfile_t)) != 0)
|
||||
{
|
||||
fclose(handle);
|
||||
Com_Printf("WARNING: '%s' looks as Daikatana pak. Skipped it!\n",
|
||||
packPath);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
numFiles = header.dirlen / sizeof(dpackfile_t);
|
||||
|
||||
if ((numFiles == 0) || (header.dirlen < 0) || (header.dirofs < 0))
|
||||
|
|
Loading…
Reference in a new issue