diff options
Diffstat (limited to 'security/selinux/ss/policydb.c')
-rw-r--r-- | security/selinux/ss/policydb.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c index 23c6e53c102c..c57802a164d5 100644 --- a/security/selinux/ss/policydb.c +++ b/security/selinux/ss/policydb.c | |||
@@ -40,7 +40,7 @@ | |||
40 | #define _DEBUG_HASHES | 40 | #define _DEBUG_HASHES |
41 | 41 | ||
42 | #ifdef DEBUG_HASHES | 42 | #ifdef DEBUG_HASHES |
43 | static char *symtab_name[SYM_NUM] = { | 43 | static const char *symtab_name[SYM_NUM] = { |
44 | "common prefixes", | 44 | "common prefixes", |
45 | "classes", | 45 | "classes", |
46 | "roles", | 46 | "roles", |
@@ -156,12 +156,11 @@ static int roles_init(struct policydb *p) | |||
156 | rc = -EINVAL; | 156 | rc = -EINVAL; |
157 | goto out_free_role; | 157 | goto out_free_role; |
158 | } | 158 | } |
159 | key = kmalloc(strlen(OBJECT_R)+1, GFP_KERNEL); | 159 | key = kstrdup(OBJECT_R, GFP_KERNEL); |
160 | if (!key) { | 160 | if (!key) { |
161 | rc = -ENOMEM; | 161 | rc = -ENOMEM; |
162 | goto out_free_role; | 162 | goto out_free_role; |
163 | } | 163 | } |
164 | strcpy(key, OBJECT_R); | ||
165 | rc = hashtab_insert(p->p_roles.table, key, role); | 164 | rc = hashtab_insert(p->p_roles.table, key, role); |
166 | if (rc) | 165 | if (rc) |
167 | goto out_free_key; | 166 | goto out_free_key; |
@@ -2195,7 +2194,7 @@ int policydb_read(struct policydb *p, void *fp) | |||
2195 | rangetr_hash_eval(p->range_tr); | 2194 | rangetr_hash_eval(p->range_tr); |
2196 | } | 2195 | } |
2197 | 2196 | ||
2198 | p->type_attr_map = kmalloc(p->p_types.nprim*sizeof(struct ebitmap), GFP_KERNEL); | 2197 | p->type_attr_map = kmalloc(p->p_types.nprim * sizeof(struct ebitmap), GFP_KERNEL); |
2199 | if (!p->type_attr_map) | 2198 | if (!p->type_attr_map) |
2200 | goto bad; | 2199 | goto bad; |
2201 | 2200 | ||