diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2017-03-31 18:21:18 +0300 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2017-03-31 15:16:18 -0400 |
commit | cae303df3f379f04ce7efadb2e30de460918b302 (patch) | |
tree | 774a804b281390db6ce535ef5a1532db44faaff9 /security | |
parent | 342e91578eb6909529bc7095964cd44b9c057c4e (diff) |
selinux: Fix an uninitialized variable bug
We removed this initialization as a cleanup but it is probably required.
The concern is that "nel" can be zero. I'm not an expert on SELinux
code but I think it looks possible to write an SELinux policy which
triggers this bug. GCC doesn't catch this, but my static checker does.
Fixes: 9c312e79d6af ("selinux: Delete an unnecessary variable initialisation in range_read()")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'security')
-rw-r--r-- | security/selinux/ss/policydb.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c index 658247f98dc1..0080122760ad 100644 --- a/security/selinux/ss/policydb.c +++ b/security/selinux/ss/policydb.c @@ -1832,7 +1832,7 @@ u32 string_to_av_perm(struct policydb *p, u16 tclass, const char *name) static int range_read(struct policydb *p, void *fp) { - struct range_trans *rt; + struct range_trans *rt = NULL; struct mls_range *r = NULL; int i, rc; __le32 buf[2]; |