mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-26 13:50:53 +00:00
Should fix the Nexuiz menu crash reported by TimeServ
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1457 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
fc770f310d
commit
2fa6c2b103
2 changed files with 118 additions and 112 deletions
|
@ -427,13 +427,13 @@ unsigned int *ED_FindGlobalOfsFromProgs (progfuncs_t *progfuncs, char *name, pro
|
|||
ED_FindFunction
|
||||
============
|
||||
*/
|
||||
dfunction_t *ED_FindFunction (progfuncs_t *progfuncs, char *name, progsnum_t *prnum, unsigned int fromprogs)
|
||||
dfunction_t *ED_FindFunction (progfuncs_t *progfuncs, char *name, progsnum_t *prnum, progsnum_t fromprogs)
|
||||
{
|
||||
dfunction_t *func;
|
||||
unsigned int i;
|
||||
char *sep;
|
||||
|
||||
int pnum;
|
||||
progsnum_t pnum;
|
||||
|
||||
if (prnum)
|
||||
{
|
||||
|
@ -455,6 +455,12 @@ dfunction_t *ED_FindFunction (progfuncs_t *progfuncs, char *name, progsnum_t *pr
|
|||
else
|
||||
pnum = pr_typecurrent;
|
||||
|
||||
if ((unsigned)pnum > (unsigned)maxprogs)
|
||||
{
|
||||
printf("Progsnum %i out of bounds\n", pnum);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!pr_progstate[pnum].progs)
|
||||
return NULL;
|
||||
|
||||
|
|
|
@ -426,7 +426,7 @@ ddef32_t *ED_FindTypeGlobalFromProgs32 (progfuncs_t *progfuncs, char *name, prog
|
|||
ddef16_t *ED_FindGlobalFromProgs16 (progfuncs_t *progfuncs, char *name, progsnum_t prnum);
|
||||
ddef32_t *ED_FindGlobalFromProgs32 (progfuncs_t *progfuncs, char *name, progsnum_t prnum);
|
||||
fdef_t *ED_FindField (progfuncs_t *progfuncs, char *name);
|
||||
dfunction_t *ED_FindFunction (progfuncs_t *progfuncs, char *name, progsnum_t *pnum, unsigned int fromprogs);
|
||||
dfunction_t *ED_FindFunction (progfuncs_t *progfuncs, char *name, progsnum_t *pnum, progsnum_t fromprogs);
|
||||
func_t PR_FindFunc(progfuncs_t *progfncs, char *funcname, progsnum_t pnum);
|
||||
void PR_Configure (progfuncs_t *progfncs, int addressable_size, int max_progs);
|
||||
int PR_InitEnts(progfuncs_t *progfncs, int maxents);
|
||||
|
|
Loading…
Reference in a new issue