]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Assert _before_ allowing talloc_get_type_abort to trip
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 2 Jun 2025 05:12:07 +0000 (23:12 -0600)
committerNick Porter <nick@portercomputing.co.uk>
Wed, 18 Jun 2025 12:53:16 +0000 (13:53 +0100)
src/lib/unlang/module.c

index f6d84031d0def0d92abb7d01b8a039063bf9fa52..b7a74b4d3f76f84a86aea9e7c37bc7e46b3c8d4d 100644 (file)
@@ -436,7 +436,7 @@ unlang_action_t unlang_module_yield(request_t *request,
 {
        unlang_stack_t                  *stack = request->stack;
        unlang_stack_frame_t            *frame = &stack->frame[stack->depth];
-       unlang_frame_state_module_t     *state = talloc_get_type_abort(frame->state, unlang_frame_state_module_t);
+       unlang_frame_state_module_t     *state;
 
        REQUEST_VERIFY(request);        /* Check the yielded request is sane */
 
@@ -445,6 +445,8 @@ unlang_action_t unlang_module_yield(request_t *request,
                return UNLANG_ACTION_FAIL;
        }
 
+       state = talloc_get_type_abort(frame->state, unlang_frame_state_module_t);
+
        state->rctx = rctx;
        state->resume = resume;