Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 201888
b: refs/heads/master
c: fc5c126
h: refs/heads/master
v: v3
  • Loading branch information
Dan Carpenter authored and James Morris committed Aug 2, 2010
1 parent 8fdab4d commit 0909fe2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9d623b17a740d5a85c12108cdc71c64fb15484fc
refs/heads/master: fc5c126e4733e6fb3080d3d822ca63226e74fc84
20 changes: 12 additions & 8 deletions trunk/security/selinux/ss/conditional.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,24 +392,25 @@ static int cond_read_node(struct policydb *p, struct cond_node *node, void *fp)
struct cond_expr *expr = NULL, *last = NULL;

rc = next_entry(buf, fp, sizeof(u32));
if (rc < 0)
return -1;
if (rc)
return rc;

node->cur_state = le32_to_cpu(buf[0]);

len = 0;
rc = next_entry(buf, fp, sizeof(u32));
if (rc < 0)
return -1;
if (rc)
return rc;

/* expr */
len = le32_to_cpu(buf[0]);

for (i = 0; i < len; i++) {
rc = next_entry(buf, fp, sizeof(u32) * 2);
if (rc < 0)
if (rc)
goto err;

rc = -ENOMEM;
expr = kzalloc(sizeof(struct cond_expr), GFP_KERNEL);
if (!expr)
goto err;
Expand All @@ -418,6 +419,7 @@ static int cond_read_node(struct policydb *p, struct cond_node *node, void *fp)
expr->bool = le32_to_cpu(buf[1]);

if (!expr_isvalid(p, expr)) {
rc = -EINVAL;
kfree(expr);
goto err;
}
Expand All @@ -429,14 +431,16 @@ static int cond_read_node(struct policydb *p, struct cond_node *node, void *fp)
last = expr;
}

if (cond_read_av_list(p, fp, &node->true_list, NULL) != 0)
rc = cond_read_av_list(p, fp, &node->true_list, NULL);
if (rc)
goto err;
if (cond_read_av_list(p, fp, &node->false_list, node->true_list) != 0)
rc = cond_read_av_list(p, fp, &node->false_list, node->true_list);
if (rc)
goto err;
return 0;
err:
cond_node_destroy(node);
return -1;
return rc;
}

int cond_read_list(struct policydb *p, void *fp)
Expand Down

0 comments on commit 0909fe2

Please sign in to comment.