selinux: Fix an uninitialized variable bug
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 31 Mar 2017 15:21:18 +0000 (18:21 +0300)
committerPaul Moore <paul@paul-moore.com>
Fri, 31 Mar 2017 19:16:18 +0000 (15:16 -0400)
commitcae303df3f379f04ce7efadb2e30de460918b302
tree774a804b281390db6ce535ef5a1532db44faaff9
parent342e91578eb6909529bc7095964cd44b9c057c4e
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>
security/selinux/ss/policydb.c