]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
check undefined attributes
authorAlan T. DeKok <aland@freeradius.org>
Mon, 14 Dec 2015 15:34:10 +0000 (10:34 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 14 Dec 2015 15:44:24 +0000 (10:44 -0500)
src/main/modcall.c
src/tests/keywords/case-attr-error [new file with mode: 0644]

index cd46e24c17062f768414c68f35e301b9c81bf017..5b4b99ab2ee48842849759db7b81d52509bd5e01 100644 (file)
@@ -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 (file)
index 0000000..e9516cc
--- /dev/null
@@ -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 {
+       }
+}