From: Alan T. DeKok Date: Mon, 14 Dec 2015 15:34:10 +0000 (-0500) Subject: check undefined attributes X-Git-Tag: release_3_0_11~85 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c3dacd8f3ea450e1fbc7ef4d8bc1dd20ad939d3;p=thirdparty%2Ffreeradius-server.git check undefined attributes --- diff --git a/src/main/modcall.c b/src/main/modcall.c index cd46e24c170..5b4b99ab2ee 100644 --- a/src/main/modcall.c +++ b/src/main/modcall.c @@ -3778,6 +3778,12 @@ bool modcall_pass2(modcallable *mc) goto do_children; } + if (g->vpt->type == TMPL_TYPE_ATTR_UNDEFINED) { + if (!pass2_fixup_undefined(cf_section_to_item(g->cs), g->vpt)) { + return false; + } + } + /* * Compile and sanity check xlat * expansions. diff --git a/src/tests/keywords/case-attr-error b/src/tests/keywords/case-attr-error new file mode 100644 index 00000000000..e9516cc1b34 --- /dev/null +++ b/src/tests/keywords/case-attr-error @@ -0,0 +1,20 @@ +# PRE: case-empty +# +update reply { + Filter-Id := "fail" +} + +switch &reply:Filter-Id { + # deliberately empty + case "filter" { + } + + case &Not-Dynamically-Allocated { # ERROR + update reply { + Filter-Id := "fail" + } + } + + case { + } +}