projects
/
GitHub
/
LineageOS
/
G12
/
android_kernel_amlogic_linux-4.9.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
aa736c3
)
selinux: use kstrdup() in security_get_bools()
author
Rasmus Villemoes
<linux@rasmusvillemoes.dk>
Wed, 21 Oct 2015 21:44:26 +0000
(17:44 -0400)
committer
Paul Moore
<pmoore@redhat.com>
Wed, 21 Oct 2015 21:44:26 +0000
(17:44 -0400)
This is much simpler.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Paul Moore <pmoore@redhat.com>
security/selinux/ss/services.c
patch
|
blob
|
blame
|
history
diff --git
a/security/selinux/ss/services.c
b/security/selinux/ss/services.c
index 994c824a34c650268ec783a9de1a2ee3b8a4c39d..aa2bdcb20848c417f53c7384be2f00ee0ba6895b 100644
(file)
--- a/
security/selinux/ss/services.c
+++ b/
security/selinux/ss/services.c
@@
-2609,18
+2609,12
@@
int security_get_bools(int *len, char ***names, int **values)
goto err;
for (i = 0; i < *len; i++) {
- size_t name_len;
-
(*values)[i] = policydb.bool_val_to_struct[i]->state;
- name_len = strlen(sym_name(&policydb, SYM_BOOLS, i)) + 1;
rc = -ENOMEM;
- (*names)[i] = k
malloc(sizeof(char) * name_len
, GFP_ATOMIC);
+ (*names)[i] = k
strdup(sym_name(&policydb, SYM_BOOLS, i)
, GFP_ATOMIC);
if (!(*names)[i])
goto err;
-
- strncpy((*names)[i], sym_name(&policydb, SYM_BOOLS, i), name_len);
- (*names)[i][name_len - 1] = 0;
}
rc = 0;
out: