summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@open.eurogiciel.org>2014-09-15 11:42:04 +0200
committerStephane Desneux <stephane.desneux@open.eurogiciel.org>2015-02-04 11:23:26 +0100
commit5220ab04dc44e3b8b6c2d5789d27a89906efbe5e (patch)
tree2ac2f859115aefdf95d6a3c4b2258d8cfd514527
parentea2e0e05e43104dd9ae6d3cac82525b903b6d297 (diff)
downloadkernel-common-5220ab04dc44e3b8b6c2d5789d27a89906efbe5e.tar.gz
kernel-common-5220ab04dc44e3b8b6c2d5789d27a89906efbe5e.tar.bz2
kernel-common-5220ab04dc44e3b8b6c2d5789d27a89906efbe5e.zip
SMACK: Fix wrong copy size
The function strncpy was copying an extra character 9 when i == len (what is possible via revoke interface). Change-Id: Ic7452da05773e620a1d7bbc55e859c25a86c65f6 Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>
-rw-r--r--security/smack/smack_access.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/security/smack/smack_access.c b/security/smack/smack_access.c
index c062e9467b62..930e548916f3 100644
--- a/security/smack/smack_access.c
+++ b/security/smack/smack_access.c
@@ -432,7 +432,7 @@ char *smk_parse_smack(const char *string, int len)
smack = kzalloc(i + 1, GFP_KERNEL);
if (smack != NULL) {
- strncpy(smack, string, i + 1);
+ strncpy(smack, string, i);
smack[i] = '\0';
}
return smack;