Commit 7ee95850 authored by James Morris's avatar James Morris

apparmor: sparse fix: rename shadowed variables in policy_unpack.c

Fix the following warnings:

security/apparmor/policy_unpack.c:384:35: warning: symbol 'size' shadows an earlier one
security/apparmor/policy_unpack.c:370:24: originally declared here
security/apparmor/policy_unpack.c:443:29: warning: symbol 'tmp' shadows an earlier one
security/apparmor/policy_unpack.c:434:21: originally declared here
Signed-off-by: default avatarJames Morris <jmorris@namei.org>
Acked-by: default avatarJohn Johansen <john.johansen@canonical.com>
parent 32c3df63
...@@ -381,11 +381,11 @@ static bool unpack_trans_table(struct aa_ext *e, struct aa_profile *profile) ...@@ -381,11 +381,11 @@ static bool unpack_trans_table(struct aa_ext *e, struct aa_profile *profile)
profile->file.trans.size = size; profile->file.trans.size = size;
for (i = 0; i < size; i++) { for (i = 0; i < size; i++) {
char *str; char *str;
int c, j, size = unpack_strdup(e, &str, NULL); int c, j, size2 = unpack_strdup(e, &str, NULL);
/* unpack_strdup verifies that the last character is /* unpack_strdup verifies that the last character is
* null termination byte. * null termination byte.
*/ */
if (!size) if (!size2)
goto fail; goto fail;
profile->file.trans.table[i] = str; profile->file.trans.table[i] = str;
/* verify that name doesn't start with space */ /* verify that name doesn't start with space */
...@@ -393,7 +393,7 @@ static bool unpack_trans_table(struct aa_ext *e, struct aa_profile *profile) ...@@ -393,7 +393,7 @@ static bool unpack_trans_table(struct aa_ext *e, struct aa_profile *profile)
goto fail; goto fail;
/* count internal # of internal \0 */ /* count internal # of internal \0 */
for (c = j = 0; j < size - 2; j++) { for (c = j = 0; j < size2 - 2; j++) {
if (!str[j]) if (!str[j])
c++; c++;
} }
...@@ -440,11 +440,11 @@ static bool unpack_rlimits(struct aa_ext *e, struct aa_profile *profile) ...@@ -440,11 +440,11 @@ static bool unpack_rlimits(struct aa_ext *e, struct aa_profile *profile)
if (size > RLIM_NLIMITS) if (size > RLIM_NLIMITS)
goto fail; goto fail;
for (i = 0; i < size; i++) { for (i = 0; i < size; i++) {
u64 tmp = 0; u64 tmp2 = 0;
int a = aa_map_resource(i); int a = aa_map_resource(i);
if (!unpack_u64(e, &tmp, NULL)) if (!unpack_u64(e, &tmp2, NULL))
goto fail; goto fail;
profile->rlimits.limits[a].rlim_max = tmp; profile->rlimits.limits[a].rlim_max = tmp2;
} }
if (!unpack_nameX(e, AA_ARRAYEND, NULL)) if (!unpack_nameX(e, AA_ARRAYEND, NULL))
goto fail; goto fail;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment