mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
get the range of the zone right. crashing on what should be a perfectly valid value is just plain bogus :P
This is an imperfect revision of history.
This commit is contained in:
parent
2488465bc9
commit
4a7e2ff093
1 changed files with 5 additions and 3 deletions
|
@ -60,10 +60,12 @@ get_inputline (progs_t *pr, int arg, const char *func)
|
|||
{
|
||||
pr_type_t *handle;
|
||||
inputline_t *line;
|
||||
int min = (pr_type_t *) pr->zone - pr->pr_globals;
|
||||
int max = min + pr->zone_size / sizeof (pr_type_t);
|
||||
|
||||
if (arg <= ((pr_type_t *) pr->zone - pr->pr_globals)
|
||||
|| (size_t) arg >= (pr->zone_size / sizeof (pr_type_t)))
|
||||
PR_RunError (pr, "%s: Invalid inputline_t", func);
|
||||
if (arg <= min || arg >= max)
|
||||
PR_RunError (pr, "%s: Invalid inputline_t: $%x $%x $%x", func, arg,
|
||||
min, max);
|
||||
|
||||
handle = pr->pr_globals + arg;
|
||||
|
||||
|
|
Loading…
Reference in a new issue