]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
use fr_pair_afrom_da()
authorAlan T. DeKok <aland@freeradius.org>
Thu, 10 Jun 2021 14:02:11 +0000 (10:02 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 10 Jun 2021 14:05:32 +0000 (10:05 -0400)
only internal code should use fr_pair_afrom_num(), and even then
it should only use hard-coded numbers.

src/modules/proto_vmps/vqp.c

index 8ab822d01ec44ba2cde9b14fdfec7e587f899211..9667387abce8e6488a1389c66e08bd355060aa81 100644 (file)
@@ -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);