]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Disallow TMPL_TYPE_ATTR_UNDEFINED and throw an error in pass2
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 17 May 2015 22:46:48 +0000 (18:46 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 17 May 2015 22:56:07 +0000 (18:56 -0400)
src/main/conffile.c

index de8f28ede6562b323373ab6ed76be18671a108ad..377bd4396f583e94255ab8aa08d312edc6928b8c 100644 (file)
@@ -1793,9 +1793,15 @@ int cf_section_parse_pass2(CONF_SECTION *cs, void *base, CONF_PARSER const *vari
                         *      Don't add default - update with new types.
                         */
                        switch (vpt->type) {
+                       /*
+                        *      All attributes should have been defined by this point.
+                        */
+                       case TMPL_TYPE_ATTR_UNDEFINED:
+                               cf_log_err(&cp->item, "Unknown attribute '%s'", vpt->tmpl_unknown_name);
+                               return -1;
+
                        case TMPL_TYPE_LITERAL:
                        case TMPL_TYPE_ATTR:
-                       case TMPL_TYPE_ATTR_UNDEFINED:
                        case TMPL_TYPE_LIST:
                        case TMPL_TYPE_DATA:
                        case TMPL_TYPE_EXEC: