From: Alan T. DeKok Date: Thu, 10 Jun 2021 14:02:11 +0000 (-0400) Subject: use fr_pair_afrom_da() X-Git-Tag: release_3_0_23~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ef8bb50f41c9db490a55af35ac95c9b6c5bb56b;p=thirdparty%2Ffreeradius-server.git use fr_pair_afrom_da() only internal code should use fr_pair_afrom_num(), and even then it should only use hard-coded numbers. --- diff --git a/src/modules/proto_vmps/vqp.c b/src/modules/proto_vmps/vqp.c index 8ab822d01ec..9667387abce 100644 --- a/src/modules/proto_vmps/vqp.c +++ b/src/modules/proto_vmps/vqp.c @@ -459,6 +459,7 @@ int vqp_decode(RADIUS_PACKET *packet) */ while (ptr < end) { char *p; + DICT_ATTR const *da; if ((end - ptr) < 6) break; @@ -472,7 +473,14 @@ int vqp_decode(RADIUS_PACKET *packet) * Hack to get the dictionaries to work correctly. */ attribute |= 0x2000; - vp = fr_pair_afrom_num(packet, attribute, 0); + + /* + * We don't care about unknown attributes in VQP. + */ + da = dict_attrbyvalue(attribute, 0); + if (!da) continue; + + vp = fr_pair_afrom_da(packet, da); if (!vp) { fr_pair_list_free(&packet->vps);