apparmor: fix uninitialize table variable in error in unpack_trans_table
authorJohn Johansen <john.johansen@canonical.com>
Mon, 10 Oct 2022 18:18:50 +0000 (11:18 -0700)
committerJohn Johansen <john.johansen@canonical.com>
Mon, 10 Oct 2022 18:18:50 +0000 (11:18 -0700)
The error path has one case where *table is uninitialized, initialize
it.

Fixes: a0792e2ceddc ("apparmor: make transition table unpack generic so it can be reused")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
security/apparmor/policy_unpack.c

index 09f3169..3b956b1 100644 (file)
@@ -477,7 +477,7 @@ static struct aa_dfa *unpack_dfa(struct aa_ext *e, int flags)
 static bool unpack_trans_table(struct aa_ext *e, struct aa_str_table *strs)
 {
        void *saved_pos = e->pos;
-       char **table;
+       char **table = NULL;
 
        /* exec table is optional */
        if (unpack_nameX(e, AA_STRUCT, "xtable")) {