From 130494f7740f2e6f6de897b543737e05266519cb Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 22 Jul 2012 12:08:09 +0900 Subject: [PATCH] Bail out if the saved game data has too many entities. --- nq/source/host_cmd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nq/source/host_cmd.c b/nq/source/host_cmd.c index d0970eed2..f73e8ebab 100644 --- a/nq/source/host_cmd.c +++ b/nq/source/host_cmd.c @@ -697,6 +697,8 @@ Host_Loadgame_f (void) list = PL_ObjectForKey (game, "entities"); entnum = 0; count = PL_A_NumObjects (list); + if (count > sv.max_edicts) + Host_Error ("too many entities in saved game. adjust max_edicts\n"); for (entnum = 0; entnum < count; entnum++) { plitem_t *entity = PL_ObjectAtIndex (list, entnum); edict_t *ent = EDICT_NUM (&sv_pr_state, entnum);