diff options
| author | 2007-07-25 11:28:19 -0700 | |
|---|---|---|
| committer | 2007-07-25 11:28:19 -0700 | |
| commit | 80492cc797ea15572de8eac766cbf606626ee338 (patch) | |
| tree | 415c2bdddfed5645aaa93c06b08cceb6403e9595 | |
| parent | Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6 (diff) | |
| parent | SELinux: null-terminate context string in selinux_xfrm_sec_ctx_alloc (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/selinux-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/selinux-2.6:
SELinux: null-terminate context string in selinux_xfrm_sec_ctx_alloc
| -rw-r--r-- | security/selinux/xfrm.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/security/selinux/xfrm.c b/security/selinux/xfrm.c index bd8d1ef40a90..ba715f40b658 100644 --- a/security/selinux/xfrm.c +++ b/security/selinux/xfrm.c @@ -216,7 +216,7 @@ static int selinux_xfrm_sec_ctx_alloc(struct xfrm_sec_ctx **ctxp, return -ENOMEM; *ctxp = ctx = kmalloc(sizeof(*ctx) + - uctx->ctx_len, + uctx->ctx_len + 1, GFP_KERNEL); if (!ctx) @@ -229,6 +229,7 @@ static int selinux_xfrm_sec_ctx_alloc(struct xfrm_sec_ctx **ctxp, memcpy(ctx->ctx_str, uctx+1, ctx->ctx_len); + ctx->ctx_str[ctx->ctx_len] = 0; rc = security_context_to_sid(ctx->ctx_str, ctx->ctx_len, &ctx->ctx_sid); |
