diff --git a/libs/gamecode/pr_exec.c b/libs/gamecode/pr_exec.c index 03182e372..4ab985849 100644 --- a/libs/gamecode/pr_exec.c +++ b/libs/gamecode/pr_exec.c @@ -257,7 +257,7 @@ PR_LeaveFunction (progs_t *pr) VISIBLE void PR_BoundsCheckSize (progs_t *pr, pointer_t addr, unsigned size) { - if (addr < pr->pr_real_params[0] - pr->pr_globals) + if (addr < pr->pr_return - pr->pr_globals) PR_RunError (pr, "null pointer access"); if (addr >= pr->globals_size || size > (unsigned) (pr->globals_size - addr))