From: Nick Porter Date: Mon, 7 Jul 2025 15:03:47 +0000 (+0100) Subject: Add checks that tmpl expansion created a value X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ceb044f4baa1c5a69e8a7df13fea8d9717138b55;p=thirdparty%2Ffreeradius-server.git Add checks that tmpl expansion created a value --- diff --git a/src/lib/unlang/limit.c b/src/lib/unlang/limit.c index 5a1291e1da6..1dc6c90031f 100644 --- a/src/lib/unlang/limit.c +++ b/src/lib/unlang/limit.c @@ -88,6 +88,7 @@ static unlang_action_t unlang_limit_xlat_done(unlang_result_t *p_result, request unlang_frame_state_limit_t *state = talloc_get_type_abort(frame->state, unlang_frame_state_limit_t); fr_value_box_t *box = fr_value_box_list_head(&state->result); + if (unlikely(!box)) RETURN_UNLANG_FAIL; /* * compile_limit() ensures that the tmpl is cast to uint32, so we don't have to do any more work here. */ diff --git a/src/modules/rlm_ldap/groups.c b/src/modules/rlm_ldap/groups.c index 12a5e576be0..b54d231a8a0 100644 --- a/src/modules/rlm_ldap/groups.c +++ b/src/modules/rlm_ldap/groups.c @@ -580,7 +580,7 @@ static unlang_action_t ldap_cacheable_groupobj_start(unlang_result_t *p_result, filter = fr_value_box_list_head(&group_ctx->expanded_filter); - if (filter->type != FR_TYPE_STRING) RETURN_UNLANG_FAIL; + if (!filter || filter->type != FR_TYPE_STRING) RETURN_UNLANG_FAIL; group_ctx->attrs[0] = inst->group.obj_name_attr; return fr_ldap_trunk_search(group_ctx, &group_ctx->query, request, group_ctx->ttrunk,