Enforce limitations
authorAlan T. DeKok <aland@freeradius.org>
Tue, 13 Oct 2009 08:48:24 +0000 (10:48 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 31 May 2010 08:16:20 +0000 (10:16 +0200)
src/lib/radius.c

index 4cdfc09..44b00d3 100644 (file)
@@ -2538,6 +2538,7 @@ static uint8_t *rad_coalesce(unsigned int attribute, int vendor,
 }
 
 extern int fr_wimax_shift[];
+extern int fr_wimax_mast[];
 
 
 /*
@@ -2564,6 +2565,15 @@ static VALUE_PAIR *tlv2wimax(const RADIUS_PACKET *packet,
                    (y[1] < 2) || ((y + y[1]) > (ptr + len))) {
                        return NULL;
                }
+
+               /*
+                *      Attribute number is too large for us to
+                *      represent it in our horrible internal
+                *      representation.
+                */
+               if ((ptr[0] & ~fr_wimax_mask[nest]) != 0) {
+                       return NULL;
+               }
        }
 
        for (y = ptr; y < (ptr + len); y += y[1]) {