Skip to content

Commit

Permalink
libsepol/cil: Return an error if a call argument fails to resolve
Browse files Browse the repository at this point in the history
Return an error if a call argument fails to resolve so that
the resolution phase stops and returns an error.

This problem was found by the secilc-fuzzer.

Signed-off-by: James Carter <jwcart2@gmail.com>
  • Loading branch information
jwcart2 committed May 4, 2021
1 parent d438b6c commit d943369
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libsepol/cil/src/cil_resolve_ast.c
Expand Up @@ -3277,6 +3277,7 @@ int cil_resolve_call2(struct cil_tree_node *current, void *extra_args)
if (sym_index != CIL_SYM_UNKNOWN) {
rc = cil_resolve_name(current, arg->arg_str, sym_index, extra_args, &(arg->arg));
if (rc != SEPOL_OK) {
cil_tree_log(current, CIL_ERR, "Failed to resolve %s in call argument list", arg->arg_str);
goto exit;
}
}
Expand Down Expand Up @@ -3308,7 +3309,7 @@ int cil_resolve_name_call_args(struct cil_call *call, char *name, enum cil_sym_i
if (param_index == sym_index) {
if (name == arg->param_str) {
*datum = arg->arg;
rc = SEPOL_OK;
rc = *datum ? SEPOL_OK : SEPOL_ERR;
goto exit;
}
}
Expand Down

0 comments on commit d943369

Please sign in to comment.