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.
VALUE_PAIR *vp;
size_t n = remain;
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) {
vp = paircreate(attrid, PW_TYPE_OCTETS);
if (vp == NULL) {