kernel_optimize_test/security/selinux/ss
Julia Lawall b3139bbc52 security/selinux/ss: Use kstrdup
Use kstrdup when the goal of an allocation is copy a string into the
allocated region.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression from,to;
expression flag,E1,E2;
statement S;
@@

-  to = kmalloc(strlen(from) + 1,flag);
+  to = kstrdup(from, flag);
   ... when != \(from = E1 \| to = E1 \)
   if (to==NULL || ...) S
   ... when != \(from = E2 \| to = E2 \)
-  strcpy(to, from);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Eric Paris <eparis@redhat.com>
Signed-off-by: James Morris <jmorris@namei.org>
2010-05-17 09:00:27 +10:00
..
avtab.c selinux: Unify for- and while-loop style 2008-08-15 08:40:47 +10:00
avtab.h SELinux: Reduce max avtab size to avoid page allocation failures 2010-03-16 08:31:02 +11:00
conditional.c selinux: Unify for- and while-loop style 2008-08-15 08:40:47 +10:00
conditional.h
constraint.h
context.h selinux: allow MLS->non-MLS and vice versa upon policy reload 2010-02-04 09:06:36 +11:00
ebitmap.c netlabel: fix export of SELinux categories > 127 2010-02-25 17:49:20 +11:00
ebitmap.h
hashtab.c selinux: Unify for- and while-loop style 2008-08-15 08:40:47 +10:00
hashtab.h
Makefile selinux: generate flask headers during kernel build 2009-10-07 21:56:44 +11:00
mls_types.h selinux: allow MLS->non-MLS and vice versa upon policy reload 2010-02-04 09:06:36 +11:00
mls.c Security: Fix coding style in security/ 2010-04-09 15:13:48 +10:00
mls.h selinux: allow MLS->non-MLS and vice versa upon policy reload 2010-02-04 09:06:36 +11:00
policydb.c security/selinux/ss: Use kstrdup 2010-05-17 09:00:27 +10:00
policydb.h selinux: allow MLS->non-MLS and vice versa upon policy reload 2010-02-04 09:06:36 +11:00
services.c SELinux: return error codes on policy load failure 2010-04-21 08:58:49 +10:00
services.h
sidtab.c selinux: Unify for- and while-loop style 2008-08-15 08:40:47 +10:00
sidtab.h
symtab.c Selinux: Remove unused headers slab.h in selinux/ss/symtab.c 2010-03-03 09:22:16 +11:00
symtab.h