aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2020-03-07 01:38:45 -0500
committerJoseph Hunkeler <jhunkeler@gmail.com>2020-03-07 01:38:45 -0500
commita0712f58337cc1a3805310582cf1e3f32858d9e1 (patch)
treea122960043f32f2a312058ab38e7b71466c7ebba
parenta49d19199f1e88bbb465f46ae16daad5cadc4a3f (diff)
downloadspmc-a0712f58337cc1a3805310582cf1e3f32858d9e1.tar.gz
Bugfix: Fix potential overrun by strlist_count
-rw-r--r--src/strlist.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/strlist.c b/src/strlist.c
index 5f93201..ed00fb1 100644
--- a/src/strlist.c
+++ b/src/strlist.c
@@ -31,6 +31,7 @@ void strlist_append(StrList *pStrList, char *str) {
}
pStrList->data = tmp;
pStrList->data[pStrList->num_inuse] = strdup(str);
+ pStrList->data[pStrList->num_alloc] = NULL;
strcpy(pStrList->data[pStrList->num_inuse], str);
pStrList->num_inuse++;
pStrList->num_alloc++;