mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-17 22:50:51 +00:00
fix a buffer overflow (oops, not paying attention)
This commit is contained in:
parent
0b0dfcc38e
commit
d4a4cde83c
1 changed files with 3 additions and 1 deletions
|
@ -195,7 +195,9 @@ PL_A_InsertObjectAtIndex (plitem_t *array_item, plitem_t *item, int index)
|
||||||
array = (plarray_t *)array_item->data;
|
array = (plarray_t *)array_item->data;
|
||||||
|
|
||||||
if (array->numvals == array->maxvals) {
|
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)
|
if (!tmp)
|
||||||
return NULL;
|
return NULL;
|
||||||
array->maxvals += 128;
|
array->maxvals += 128;
|
||||||
|
|
Loading…
Reference in a new issue