projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9be2f7c
)
[PATCH] selinux: check for failed kmalloc in security_sid_to_context()
author
Serge E. Hallyn
<
[email protected]
>
Mon, 15 May 2006 16:43:48 +0000
(09:43 -0700)
committer
Linus Torvalds
<
[email protected]
>
Mon, 15 May 2006 18:20:54 +0000
(11:20 -0700)
Check for NULL kmalloc return value before writing to it.
Signed-off-by: Serge E. Hallyn <
[email protected]
>
Acked-by: James Morris <
[email protected]
>
Cc: Stephen Smalley <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
security/selinux/ss/services.c
patch
|
blob
|
history
diff --git
a/security/selinux/ss/services.c
b/security/selinux/ss/services.c
index 7177e98df7f33a4e06b521fbb2bb987150838246..c284dbb8b8c02fbba51aa562d5e4fd4551e641f3 100644
(file)
--- a/
security/selinux/ss/services.c
+++ b/
security/selinux/ss/services.c
@@
-594,6
+594,10
@@
int security_sid_to_context(u32 sid, char **scontext, u32 *scontext_len)
*scontext_len = strlen(initial_sid_to_string[sid]) + 1;
scontextp = kmalloc(*scontext_len,GFP_ATOMIC);
+ if (!scontextp) {
+ rc = -ENOMEM;
+ goto out;
+ }
strcpy(scontextp, initial_sid_to_string[sid]);
*scontext = scontextp;
goto out;