From: Alan T. DeKok Date: Mon, 28 Sep 2015 13:29:13 +0000 (-0400) Subject: Don't go to next sibling on empty case. Fixes #1274 X-Git-Tag: release_3_0_10~29 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=freeradius.git;a=commitdiff_plain;h=b3d7db4cf64f37b76f847b49d85f17c318aa7b6a Don't go to next sibling on empty case. Fixes #1274 --- diff --git a/src/main/modcall.c b/src/main/modcall.c index d02b003..00324d6 100644 --- a/src/main/modcall.c +++ b/src/main/modcall.c @@ -772,6 +772,11 @@ redo: * MOD_GROUP. */ if (!g->children) { + if (c->type == MOD_CASE) { + result = RLM_MODULE_NOOP; + goto calculate_result; + } + RDEBUG2("%s { ... } # empty sub-section is ignored", c->name); goto next_sibling; } diff --git a/src/tests/keywords/case-empty b/src/tests/keywords/case-empty new file mode 100644 index 0000000..46ea054 --- /dev/null +++ b/src/tests/keywords/case-empty @@ -0,0 +1,23 @@ +# PRE: switch +# +update reply { + Filter-Id := "filter" +} + +switch &reply:Filter-Id { + # deliberately empty + case "filter" { + } + + case "fail" { + update reply { + Filter-Id := "fail" + } + } + + case { + update reply { + Filter-Id := "default" + } + } +}