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: 5379a33120 ("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>
This commit is contained in:
Geert Uytterhoeven 2017-07-06 10:56:21 +02:00 committed by John Johansen
parent 520eccdfe1
commit 19fe43a54f
1 changed files with 2 additions and 2 deletions

View File

@ -448,7 +448,7 @@ static struct aa_dfa *unpack_dfa(struct aa_ext *e)
*/ */
static bool unpack_trans_table(struct aa_ext *e, struct aa_profile *profile) static bool unpack_trans_table(struct aa_ext *e, struct aa_profile *profile)
{ {
void *pos = e->pos; void *saved_pos = e->pos;
/* exec table is optional */ /* exec table is optional */
if (unpack_nameX(e, AA_STRUCT, "xtable")) { if (unpack_nameX(e, AA_STRUCT, "xtable")) {
@ -511,7 +511,7 @@ static bool unpack_trans_table(struct aa_ext *e, struct aa_profile *profile)
fail: fail:
aa_free_domain_entries(&profile->file.trans); aa_free_domain_entries(&profile->file.trans);
e->pos = pos; e->pos = saved_pos;
return 0; return 0;
} }