]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
CUI is allowed to have zero-length
authorAlan T. DeKok <aland@freeradius.org>
Thu, 12 May 2011 08:24:56 +0000 (10:24 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 12 May 2011 08:24:56 +0000 (10:24 +0200)
src/lib/radius.c

index 9a5989f4da59653a660c33824054ac6764a4e988..33a9c30e069c2babc25379911e1d78addcfebb02 100644 (file)
@@ -1492,10 +1492,17 @@ int rad_vp2rfc(const RADIUS_PACKET *packet,
                return -1;
        }
 
+       /*
+        *      Only CUI is allowed to have zero length.
+        *      Thank you, WiMAX!
+        */
        if ((vp->length == 0) &&
-           (vp->attribute != PW_CHARGEABLE_USER_IDENTITY)) {
+           (vp->attribute == PW_CHARGEABLE_USER_IDENTITY)) {
+               ptr[0] = PW_CHARGEABLE_USER_IDENTITY;
+               ptr[1] = 2;
+
                *pvp = vp->next;
-               return 0;
+               return 2;
        }
 
        return vp2attr_rfc(packet, original, secret, pvp, vp->attribute,