Skip to content

Commit 19fe43a

Browse files
geertujrjohansen
authored andcommitted
apparmor: Fix shadowed local variable in unpack_trans_table()
with W=2: security/apparmor/policy_unpack.c: In function ‘unpack_trans_table’: security/apparmor/policy_unpack.c:469: warning: declaration of ‘pos’ shadows a previous local security/apparmor/policy_unpack.c:451: warning: shadowed declaration is here Rename the old "pos" to "saved_pos" to fix this. Fixes: 5379a33 ("apparmor: support v7 transition format compatible with label_parse") Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Serge Hallyn <serge@hallyn.com> Signed-off-by: John Johansen <john.johansen@canonical.com>
1 parent 520eccd commit 19fe43a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

security/apparmor/policy_unpack.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ static struct aa_dfa *unpack_dfa(struct aa_ext *e)
448448
*/
449449
static bool unpack_trans_table(struct aa_ext *e, struct aa_profile *profile)
450450
{
451-
void *pos = e->pos;
451+
void *saved_pos = e->pos;
452452

453453
/* exec table is optional */
454454
if (unpack_nameX(e, AA_STRUCT, "xtable")) {
@@ -511,7 +511,7 @@ static bool unpack_trans_table(struct aa_ext *e, struct aa_profile *profile)
511511

512512
fail:
513513
aa_free_domain_entries(&profile->file.trans);
514-
e->pos = pos;
514+
e->pos = saved_pos;
515515
return 0;
516516
}
517517

0 commit comments

Comments
 (0)