[hackers] [ubase] Ensure opts is null-terminated before calling strcat() || sin

From: <git_AT_suckless.org>
Date: Mon, 10 Feb 2014 20:07:45 +0100

commit 471432a9e69cfa6df095089838f779b73e916ed4
Author: sin <sin_AT_2f30.org>
Date: Mon Feb 10 19:06:42 2014 +0000

    Ensure opts is null-terminated before calling strcat()

diff --git a/insmod.c b/insmod.c
index e175a1c..484c544 100644
--- a/insmod.c
+++ b/insmod.c
_AT_@ -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)
Received on Mon Feb 10 2014 - 20:07:45 CET

This archive was generated by hypermail 2.3.0 : Mon Feb 10 2014 - 20:12:22 CET