Skip to content
Snippets Groups Projects
Commit db2f8a50 authored by toaster's avatar toaster
Browse files

Make sure that the number of files you're trying to add is properly considered!

parent 47e17125
No related branches found
No related tags found
2 merge requests!252OpenGL: Public flatsprite: The Fixening,!187A bunch of bugfixes about too many wads in netgames
......@@ -331,6 +331,7 @@ INT32 CL_CheckFiles(void)
char wadfilename[MAX_WADPATH];
INT32 ret = 1;
size_t packetsize = 0;
size_t filestoget = 0;
serverinfo_pak *dummycheck = NULL;
// Shut the compiler up.
......@@ -408,10 +409,12 @@ INT32 CL_CheckFiles(void)
packetsize += nameonlylength(fileneeded[i].filename) + 22;
if ((numwadfiles >= MAX_WADFILES)
if ((numwadfiles+filestoget >= MAX_WADFILES)
|| (packetsize > sizeof(dummycheck->fileneeded)))
return 3;
filestoget++;
fileneeded[i].status = findfile(fileneeded[i].filename, fileneeded[i].md5sum, true);
CONS_Debug(DBG_NETPLAY, "found %d\n", fileneeded[i].status);
if (fileneeded[i].status != FS_FOUND)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment