]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
tools/insmod: initialize use_syslog
authorEmil Velikov <emil.l.velikov@gmail.com>
Thu, 3 Oct 2024 16:02:45 +0000 (17:02 +0100)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Wed, 9 Oct 2024 04:20:31 +0000 (23:20 -0500)
Initialize the variable, otherwise we'll get (random) stack value if the
user hasn't provided --syslog. Reported by scan-build.

Fixes: ca8f04e8 ("tools/insmod: add syslog and verbose options")
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/172
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
tools/insmod.c

index 02eea9130da07d162c57a13e49f21a8853062ec4..60b8c7c3e045ae1d22f14c3185b77debfdde8840 100644 (file)
@@ -65,7 +65,7 @@ static int do_insmod(int argc, char *argv[])
        char *opts = NULL;
        size_t optslen = 0;
        int verbose = LOG_ERR;
-       int use_syslog;
+       int use_syslog = 0;
        int i, err = 0, r = 0;
        const char *null_config = NULL;
        unsigned int flags = 0;