fix a buffer overflow (oops, not paying attention)

This commit is contained in:
Bill Currie 2003-04-08 02:56:36 +00:00
parent 0b0dfcc38e
commit d4a4cde83c

View file

@ -195,7 +195,9 @@ PL_A_InsertObjectAtIndex (plitem_t *array_item, plitem_t *item, int index)
array = (plarray_t *)array_item->data;
if (array->numvals == array->maxvals) {
plitem_t **tmp = realloc (array->values, array->maxvals + 128);
int size = (array->maxvals + 128) * sizeof (plitem_t *);
plitem_t **tmp = realloc (array->values, size);
if (!tmp)
return NULL;
array->maxvals += 128;