From: Arran Cudbard-Bell Date: Tue, 15 May 2018 03:26:07 +0000 (+0600) Subject: Remove call to radius_pair_create in rlm_digest X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d094d7d464ff4db658d3f353df322585da29900;p=thirdparty%2Ffreeradius-server.git Remove call to radius_pair_create in rlm_digest --- diff --git a/src/modules/rlm_digest/rlm_digest.c b/src/modules/rlm_digest/rlm_digest.c index 1eae5f66fa9..d5b6cd86423 100644 --- a/src/modules/rlm_digest/rlm_digest.c +++ b/src/modules/rlm_digest/rlm_digest.c @@ -177,7 +177,8 @@ static int digest_fix(REQUEST *request) * Too short. */ if (attrlen < 3) { - REDEBUG("Received Digest-Attributes with short sub-attribute %d, of length %d", p[0], attrlen); + REDEBUG("Received Digest-Attributes with short sub-attribute %d, of length %d", + p[0], attrlen); return RLM_MODULE_INVALID; } @@ -185,7 +186,8 @@ static int digest_fix(REQUEST *request) * Too long. */ if (attrlen > length) { - REDEBUG("Received Digest-Attributes with long sub-attribute %d, of length %d", p[0], attrlen); + REDEBUG("Received Digest-Attributes with long sub-attribute %d, of length %d", + p[0], attrlen); return RLM_MODULE_INVALID; } @@ -195,9 +197,10 @@ static int digest_fix(REQUEST *request) * * Didn't they know that VSA's exist? */ - sub = radius_pair_create(request->packet, &request->packet->vps, - FR_DIGEST_REALM - 1 + p[0], 0); + MEM(sub = fr_pair_afrom_child_num(request->packet, + fr_dict_root(dict_freeradius), FR_DIGEST_REALM - 1 + p[0])); fr_pair_value_bstrncpy(sub, p + 2, attrlen - 2); + fr_pair_add(&request->packet->vps, sub); RINDENT(); rdebug_pair(L_DBG_LVL_2, request, sub, "&request:");