1
0
mirror of git://git.suckless.org/ubase synced 2025-01-12 09:19:27 +00:00

Ensure opts is null-terminated before calling strcat()

This commit is contained in:
sin 2014-02-10 19:06:42 +00:00
parent deeeec8977
commit 471432a9e6

View File

@ -54,6 +54,7 @@ main(int argc, char *argv[])
opts = malloc(plen);
if (!opts)
eprintf("malloc:");
memset(opts, 0, plen);
for (i = 0; i < argc; i++) {
strcat(opts, argv[i]);
if (i + 1 < argc)