aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHarry Jeffery <harry@exec64.co.uk>2019-08-15 19:41:59 +0100
committerHarry Jeffery <harry@exec64.co.uk>2019-08-15 19:41:59 +0100
commit837d96d1b3340a804ee08374a2838844f6bf4c4c (patch)
treece55f2d68f4d498c8a05ab040d2404efbcfd0b19 /src
parentc8b6569da944a102a0d613c72b91b9ee20fcaa9e (diff)
downloadimv-837d96d1b3340a804ee08374a2838844f6bf4c4c.tar.gz
commands: Fix buffer overrun
Diffstat (limited to 'src')
-rw-r--r--src/commands.c4
1 files changed, 2 insertions, 2 deletions
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;