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
1 changed files with 1 additions and 0 deletions

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)