From 2291d8bf39a198e9063d0c2373ed8513485b1a6c Mon Sep 17 00:00:00 2001 From: divverent Date: Wed, 11 Apr 2012 10:58:16 +0000 Subject: [PATCH] fix "strings go past end of file" check git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11791 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=65d7926b2422eda155a0c4ae4a313e882f922c7e --- prvm_edict.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prvm_edict.c b/prvm_edict.c index ddda4e99..4d20f1c1 100644 --- a/prvm_edict.c +++ b/prvm_edict.c @@ -1949,7 +1949,7 @@ void PRVM_Prog_Load(prvm_prog_t *prog, const char * filename, int numrequiredfun prog->numglobals = prog->progs_numglobals; prog->entityfields = prog->progs_entityfields; - if (LittleLong(dprograms->ofs_strings) + prog->progs_numstrings >= (int)filesize) + if (LittleLong(dprograms->ofs_strings) + prog->progs_numstrings > (int)filesize) prog->error_cmd("%s: %s strings go past end of file", prog->name, filename); prog->strings = (char *)Mem_Alloc(prog->progs_mempool, prog->progs_numstrings); memcpy(prog->strings, instrings, prog->progs_numstrings); -- 2.39.2