Skip to content

Commit

Permalink
Fix potential NULL dereference for function with NULL argument list
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Sep 26, 2018
1 parent 1be13aa commit 2a53d2f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/server/xlat_eval.c
Expand Up @@ -1012,7 +1012,7 @@ xlat_action_t xlat_frame_eval(TALLOC_CTX *ctx, fr_cursor_t *out, xlat_exp_t cons
* call the function directly.
*/
xa = xlat_frame_eval_repeat(ctx, out, child, NULL, request, in, &result);
if (xa != XLAT_ACTION_DONE) goto finish;
if (xa != XLAT_ACTION_DONE || (!*in)) goto finish;
}
continue;

Expand Down
16 changes: 16 additions & 0 deletions src/tests/keywords/xlat-alternation-fail-then-func
@@ -0,0 +1,16 @@
#
# PRE: update
#

#
# Everything null
#
update request {
Tmp-String-0 !* ANY
Tmp-String-1 !* ANY
}
update request {
Tmp-String-2 := "%{%{Tmp-String-0[0]}:-%{Tmp-String-1[0]}}%{delay_10s:}"
}

success

0 comments on commit 2a53d2f

Please sign in to comment.