diff options
author | José Bollo <jose.bollo@open.eurogiciel.org> | 2014-09-15 11:42:04 +0200 |
---|---|---|
committer | Damian Hobson-Garcia <dhobsong@igel.co.jp> | 2014-12-11 16:53:34 +0900 |
commit | 25c3f231bc880acad1146be13aa5e672a9ffbf81 (patch) | |
tree | 71330dcda274b1d3e05a71cd3b48f4a9d1622d81 | |
parent | 8d150ceab8bb823758f3f35e1d08c6ac55f07dde (diff) | |
download | renesas_kernel-25c3f231bc880acad1146be13aa5e672a9ffbf81.tar.gz renesas_kernel-25c3f231bc880acad1146be13aa5e672a9ffbf81.tar.bz2 renesas_kernel-25c3f231bc880acad1146be13aa5e672a9ffbf81.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>
(cherry picked from commit 6c2772dd37934589785aa8baf83a18d300353f0e)
Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
-rw-r--r-- | security/smack/smack_access.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/security/smack/smack_access.c b/security/smack/smack_access.c index c062e9467b6..930e548916f 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; |