mirror of git://git.suckless.org/sbase
Ensure opts is null-terminated before calling strcat()
This commit is contained in:
parent
deeeec8977
commit
471432a9e6
1
insmod.c
1
insmod.c
|
@ -54,6 +54,7 @@ main(int argc, char *argv[])
|
||||||
opts = malloc(plen);
|
opts = malloc(plen);
|
||||||
if (!opts)
|
if (!opts)
|
||||||
eprintf("malloc:");
|
eprintf("malloc:");
|
||||||
|
memset(opts, 0, plen);
|
||||||
for (i = 0; i < argc; i++) {
|
for (i = 0; i < argc; i++) {
|
||||||
strcat(opts, argv[i]);
|
strcat(opts, argv[i]);
|
||||||
if (i + 1 < argc)
|
if (i + 1 < argc)
|
||||||
|
|
Loading…
Reference in New Issue