From d4a4cde83cd3b42dd0e3acdefc309cfd205ca65b Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 8 Apr 2003 02:56:36 +0000 Subject: [PATCH] fix a buffer overflow (oops, not paying attention) --- libs/util/qfplist.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/util/qfplist.c b/libs/util/qfplist.c index 3a18b9d60..b55daffd8 100644 --- a/libs/util/qfplist.c +++ b/libs/util/qfplist.c @@ -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;