From: Alan T. DeKok Date: Fri, 19 Jan 2018 14:24:03 +0000 (-0500) Subject: clarify the code X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0879867406a73daab5792dfc6e57768fa0b4bacd;p=thirdparty%2Ffreeradius-server.git clarify the code We probably also want to check for names / da being NULL... which seems to be an issue in rlm_cache.c:412 --- diff --git a/src/main/tmpl.c b/src/main/tmpl.c index 200820af5d2..0d1a566aec3 100644 --- a/src/main/tmpl.c +++ b/src/main/tmpl.c @@ -1922,11 +1922,15 @@ size_t tmpl_snprint(char *out, size_t outlen, vp_tmpl_t const *vpt) goto inst_and_tag; case TMPL_TYPE_ATTR_UNDEFINED: - case TMPL_TYPE_ATTR: *out_p++ = '&'; + p = vpt->tmpl_unknown_name; + goto print_name; - p = vpt->type == TMPL_TYPE_ATTR ? vpt->tmpl_da->name : vpt->tmpl_unknown_name; + case TMPL_TYPE_ATTR: + *out_p++ = '&'; + p = vpt->tmpl_da->name; + print_name: /* * Don't add ¤t. */