]> git.pld-linux.org Git - packages/kernel.git/blame - 0002-apparmor-Fix-shadowed-local-variable-in-unpack_trans.patch
- up to 4.13.12
[packages/kernel.git] / 0002-apparmor-Fix-shadowed-local-variable-in-unpack_trans.patch
CommitLineData
daaa955e
AM
1From c6cad5e65a23dcafa1821ca381901297664d9c64 Mon Sep 17 00:00:00 2001
2From: Geert Uytterhoeven <geert@linux-m68k.org>
3Date: Thu, 6 Jul 2017 10:56:21 +0200
4Subject: [PATCH 02/17] apparmor: Fix shadowed local variable in
5 unpack_trans_table()
6MIME-Version: 1.0
7Content-Type: text/plain; charset=UTF-8
8Content-Transfer-Encoding: 8bit
9
10with W=2:
11
12 security/apparmor/policy_unpack.c: In function ‘unpack_trans_table’:
13 security/apparmor/policy_unpack.c:469: warning: declaration of ‘pos’ shadows a previous local
14 security/apparmor/policy_unpack.c:451: warning: shadowed declaration is here
15
16Rename the old "pos" to "saved_pos" to fix this.
17
18Fixes: 5379a3312024a8be ("apparmor: support v7 transition format compatible with label_parse")
19Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
20Reviewed-by: Serge Hallyn <serge@hallyn.com>
21Signed-off-by: John Johansen <john.johansen@canonical.com>
22(cherry picked from commit 966d631935a578fadb5770f17a957ee1a969d868)
23---
24 security/apparmor/policy_unpack.c | 4 ++--
25 1 file changed, 2 insertions(+), 2 deletions(-)
26
27diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c
28index c600f4dd1783..2d5a1a007b06 100644
29--- a/security/apparmor/policy_unpack.c
30+++ b/security/apparmor/policy_unpack.c
31@@ -448,7 +448,7 @@ static struct aa_dfa *unpack_dfa(struct aa_ext *e)
32 */
33 static bool unpack_trans_table(struct aa_ext *e, struct aa_profile *profile)
34 {
35- void *pos = e->pos;
36+ void *saved_pos = e->pos;
37
38 /* exec table is optional */
39 if (unpack_nameX(e, AA_STRUCT, "xtable")) {
40@@ -511,7 +511,7 @@ static bool unpack_trans_table(struct aa_ext *e, struct aa_profile *profile)
41
42 fail:
43 aa_free_domain_entries(&profile->file.trans);
44- e->pos = pos;
45+ e->pos = saved_pos;
46 return 0;
47 }
48
49--
502.11.0
51
This page took 0.086851 seconds and 4 git commands to generate.