fix an out-by-one error that caused a buffer overrun and a crash in windows

This commit is contained in:
Bill Currie 2005-01-03 00:30:38 +00:00
parent 23f71485d1
commit 318a945a9c

View file

@ -384,7 +384,7 @@ add_sel_name (progs_t *pr, const char *name)
int ind = ++pr->selector_index; int ind = ++pr->selector_index;
int size, i; int size, i;
if (pr->selector_index > pr->selector_index_max) { if (pr->selector_index >= pr->selector_index_max) {
size = pr->selector_index_max + 128; size = pr->selector_index_max + 128;
pr->selector_sels = realloc (pr->selector_sels, pr->selector_sels = realloc (pr->selector_sels,
size * sizeof (obj_list *)); size * sizeof (obj_list *));