From 07ed4615bbe4e1a733b8cf286d06fac853f301c8 Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Thu, 7 Aug 2025 11:24:18 -0400 Subject: [PATCH] catch pop on running trigger, with empty stack --- src/lib/unlang/interpret.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/lib/unlang/interpret.c b/src/lib/unlang/interpret.c index ea9d112b7a..582c49d008 100644 --- a/src/lib/unlang/interpret.c +++ b/src/lib/unlang/interpret.c @@ -999,6 +999,15 @@ CC_HINT(hot) rlm_rcode_t unlang_interpret(request_t *request, bool running) unlang_result_t section_result = frame->section_result; /* record the result of the frame before we pop it*/ DUMP_STACK; + + /* + * Triggers can run modules which pop, and then the stack is empty. + */ + if (unlikely(stack->depth == 0)) { + fr_assert(top_frame); + break; + } + /* * Head on back up the stack */ -- 2.47.2