]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: (optlist) make sure flags are initialized
authorKarel Zak <kzak@redhat.com>
Tue, 23 Aug 2022 12:00:57 +0000 (14:00 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 3 Jan 2023 11:58:42 +0000 (12:58 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/context_veritydev.c
libmount/src/optlist.c

index 079e503d2a0fe5baca07bfb60bba69ecba1b66ee..ffa3c6804d5f879978b4aa82254ce94ecc372214 100644 (file)
@@ -515,7 +515,7 @@ int mnt_context_deferred_delete_veritydev(struct libmnt_context *cxt __attribute
 int mnt_context_is_veritydev(struct libmnt_context *cxt)
 {
        const char *src;
-       unsigned long flags;
+       unsigned long flags = 0;
        struct libmnt_optlist *ol;
 
        assert(cxt);
index 270baa4f6c115875a3854489c807888fd052f556..a81295e1ac34e9e6fe145604862d6960e47c85fb 100644 (file)
@@ -647,9 +647,9 @@ int mnt_optlist_get_flags(struct libmnt_optlist *ls, unsigned long *flags,
 {
        struct libmnt_iter itr;
        struct libmnt_opt *opt;
-       unsigned long fl = *flags;
+       unsigned long fl = 0;
 
-       if (!ls || !map)
+       if (!ls || !map || !flags)
                return -EINVAL;
 
        mnt_reset_iter(&itr, MNT_ITER_FORWARD);