fix "strings go past end of file" check
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 11 Apr 2012 10:58:16 +0000 (10:58 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 11 Apr 2012 10:58:16 +0000 (10:58 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11791 d7cf8633-e32d-0410-b094-e92efae38249

prvm_edict.c

index ddda4e9..4d20f1c 100644 (file)
@@ -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);