]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Lack of siblings to catch sections should not trigger an assert
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 30 Apr 2025 18:16:03 +0000 (14:16 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 30 Apr 2025 20:22:51 +0000 (16:22 -0400)
Lack of catch section should not trigger a warning

src/lib/unlang/catch.c

index e207edbac99270e486d3db7d81da842e0db6d614..7c23080f3bb85fed1da6574e3a327ff4b491671a 100644 (file)
@@ -81,17 +81,16 @@ unlang_action_t unlang_interpret_skip_to_catch(rlm_rcode_t *p_result, request_t
                unlang_catch_t const *c;
 
                if (unlang->type != UNLANG_TYPE_CATCH) {
-                       RWDEBUG2("Failed to 'catch' error %s",
+               not_caught:
+                       RDEBUG3("No catch section for %s",
                                fr_table_str_by_value(mod_rcode_table, *p_result, "<invalid>"));
-                       frame->next = unlang;
-                       return UNLANG_ACTION_CALCULATE_RESULT;
+                       return frame_set_next(frame, unlang);
                }
 
                c = unlang_generic_to_catch(unlang);
                if (c->catching[*p_result]) break;
        }
-
-       fr_assert(unlang != NULL);
+       if (!unlang) goto not_caught;
 
        return frame_set_next(frame, unlang);
 }