From 837d96d1b3340a804ee08374a2838844f6bf4c4c Mon Sep 17 00:00:00 2001 From: Harry Jeffery Date: Thu, 15 Aug 2019 19:41:59 +0100 Subject: commands: Fix buffer overrun --- src/commands.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/commands.c b/src/commands.c index 3808929..25ec702 100644 --- a/src/commands.c +++ b/src/commands.c @@ -27,10 +27,10 @@ static char *join_str_list(struct list *list, const char *sep, size_t start) assert(buf); } - strncat(buf, list->items[i], cap); + strncat(buf, list->items[i], cap - 1); len += item_len; - strncat(buf, sep, cap); + strncat(buf, sep, cap - 1); len += sep_len; } return buf; -- cgit v1.2.3