]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
'&' is not a valid attribute or list name
authorAlan T. DeKok <aland@freeradius.org>
Wed, 17 Jan 2018 16:09:45 +0000 (11:09 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 17 Jan 2018 16:09:45 +0000 (11:09 -0500)
src/main/tmpl.c

index 9e1c14e5b840b16f99ebd75b9c59ef9fa219bee7..200820af5d2306cb41ef8a4427a0a0defd845139 100644 (file)
@@ -611,12 +611,17 @@ ssize_t tmpl_afrom_attr_substr(TALLOC_CTX *ctx, vp_tmpl_t **out, char const *nam
        ssize_t         slen;
        vp_tmpl_t       *vpt;
 
-       MEM(vpt = talloc_zero(ctx, vp_tmpl_t));
-
        p = name;
 
        if (*p == '&') p++;
 
+       if (!*p) {
+               fr_strerror_printf("Invalid attribute name.");
+               return -1;
+       }
+
+       MEM(vpt = talloc_zero(ctx, vp_tmpl_t));
+
        p += radius_request_name(&vpt->tmpl_request, p, request_def);
        if (vpt->tmpl_request == REQUEST_UNKNOWN) {
                fr_strerror_printf("Invalid request qualifier");