summaryrefslogtreecommitdiff
path: root/security/smack/smack_access.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/smack/smack_access.c')
-rw-r--r--security/smack/smack_access.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/security/smack/smack_access.c b/security/smack/smack_access.c
index e0aa8bd48da..1eb94fb744a 100644
--- a/security/smack/smack_access.c
+++ b/security/smack/smack_access.c
@@ -421,10 +421,9 @@ char *smk_parse_smack(const char *string, int len)
return NULL;
smack = kzalloc(i + 1, GFP_KERNEL);
- if (smack != NULL) {
- strncpy(smack, string, i + 1);
- smack[i] = '\0';
- }
+ if (smack != NULL)
+ strncpy(smack, string, i);
+
return smack;
}