]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
catch pop on running trigger, with empty stack developer/alandekok master
authorAlan T. DeKok <aland@freeradius.org>
Thu, 7 Aug 2025 15:24:18 +0000 (11:24 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 7 Aug 2025 15:40:09 +0000 (11:40 -0400)
src/lib/unlang/interpret.c

index ea9d112b7a5cc6482b921bc383b5931d3a7c37a2..582c49d008043e76f2702b0fdd19196a05b1e375 100644 (file)
@@ -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;
                        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
                         */
                        /*
                         *      Head on back up the stack
                         */