From: Alan T. DeKok Date: Thu, 12 Nov 2009 11:25:03 +0000 (+0100) Subject: Fix WiMAX encoding bug introduced in 326a68b90a1a X-Git-Tag: release_2_1_8~78 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=630eee03ab9571f941f4651847eab5935c0eb234;p=thirdparty%2Ffreeradius-server.git Fix WiMAX encoding bug introduced in 326a68b90a1a --- diff --git a/src/lib/radius.c b/src/lib/radius.c index 326ed521723..53333033e30 100644 --- a/src/lib/radius.c +++ b/src/lib/radius.c @@ -852,14 +852,15 @@ static VALUE_PAIR *rad_vp2tlv(VALUE_PAIR *vps) } length = (end - ptr); + if (length > 255) return NULL; /* * Pack the attribute. */ ptr[0] = (vp->attribute & 0xff00) >> 8; - ptr[1] = (length & 0xff) + 2; + ptr[1] = length; - ptr += vp->length + 2; + ptr += ptr[1]; vp->flags.encoded = 1; }