Complain on references to things like "prefix ="
authorAlan T. DeKok <aland@freeradius.org>
Mon, 25 Aug 2008 21:28:49 +0000 (23:28 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 25 Aug 2008 21:28:49 +0000 (23:28 +0200)
i.e. check for cp->value == NULL, rather than core dumping

src/main/conffile.c

index c95567f..289bd2c 100644 (file)
@@ -730,6 +730,11 @@ static const char *cf_expand_variables(const char *cf, int *lineno,
                         *  Substitute the value of the variable.
                         */
                        cp = cf_itemtopair(ci);
+                       if (!cp->value) {
+                               radlog(L_ERR, "%s[%d]: Reference \"%s\" has no value",
+                                      cf, *lineno, input);
+                               return NULL;
+                       }
                        strcpy(p, cp->value);
                        p += strlen(p);
                        ptr = end + 1;