summaryrefslogtreecommitdiffstats
path: root/security/selinux/ss/conditional.c
diff options
context:
space:
mode:
authorJames Morris <james.l.morris@oracle.com>2014-07-19 17:39:19 +1000
committerJames Morris <james.l.morris@oracle.com>2014-07-19 17:39:19 +1000
commit2ccf4661f315615d018686d91d030a94001d0cc6 (patch)
treef5374b5233ba5c43a4710bc8cbc5319091da044e /security/selinux/ss/conditional.c
parent32c2e6752ff0f48fe03b9e1c7c64bde580a840d2 (diff)
parent615e51fdda6f274e94b1e905fcaf6111e0d9aa20 (diff)
downloadlinux-2ccf4661f315615d018686d91d030a94001d0cc6.tar.bz2
Merge branch 'next' of git://git.infradead.org/users/pcmoore/selinux into next
Diffstat (limited to 'security/selinux/ss/conditional.c')
-rw-r--r--security/selinux/ss/conditional.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/security/selinux/ss/conditional.c b/security/selinux/ss/conditional.c
index 377d148e7157..62c6773be0b7 100644
--- a/security/selinux/ss/conditional.c
+++ b/security/selinux/ss/conditional.c
@@ -402,19 +402,14 @@ static int cond_read_node(struct policydb *p, struct cond_node *node, void *fp)
int rc;
struct cond_expr *expr = NULL, *last = NULL;
- rc = next_entry(buf, fp, sizeof(u32));
+ rc = next_entry(buf, fp, sizeof(u32) * 2);
if (rc)
- return rc;
+ goto err;
node->cur_state = le32_to_cpu(buf[0]);
- len = 0;
- rc = next_entry(buf, fp, sizeof(u32));
- if (rc)
- return rc;
-
/* expr */
- len = le32_to_cpu(buf[0]);
+ len = le32_to_cpu(buf[1]);
for (i = 0; i < len; i++) {
rc = next_entry(buf, fp, sizeof(u32) * 2);