From 8789fa7acaa2da0097b4eb43da0cdd9a185e95e7 Mon Sep 17 00:00:00 2001 From: Sam Hartman Date: Fri, 11 Mar 2011 14:53:22 -0500 Subject: [PATCH] util_radius: radius only permits 253 octets There is an off by one error because MAX_STR_LEN from freeradius has a pad byte. Only store 253 bytes of AVP at a time. --- util_radius.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/util_radius.cpp b/util_radius.cpp index 537150d..a680741 100644 --- a/util_radius.cpp +++ b/util_radius.cpp @@ -479,8 +479,10 @@ gssEapRadiusAddAvp(OM_uint32 *minor, VALUE_PAIR *vp; size_t n = remain; - if (n > MAX_STRING_LEN) - n = MAX_STRING_LEN; + /*There's an extra byte of padding; RADIUS AVPS can only + * be 253 octets*/ + if (n > MAX_STRING_LEN-1) + n = MAX_STRING_LEN-1; vp = paircreate(attrid, PW_TYPE_OCTETS); if (vp == NULL) { -- 2.1.4