X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fradius.c;h=4baf35254009e813ce12dda6d5e2a99ef27fec4c;hb=9a4ac1ff1dd1f24208e0389d4585ed8d38cf1101;hp=5fd41987ee13e50fa814371e4f1d614241457e6f;hpb=8c50c94660f12a3900a06c06329e8c39ac568105;p=freeradius.git diff --git a/src/lib/radius.c b/src/lib/radius.c index 5fd4198..4baf352 100644 --- a/src/lib/radius.c +++ b/src/lib/radius.c @@ -3219,15 +3219,18 @@ static ssize_t data2vp(const RADIUS_PACKET *packet, ((data[0] < 0x20) || (da->flags.encrypt == FLAG_ENCRYPT_TUNNEL_PASSWORD))) { - if ((da->type == PW_TYPE_STRING) || - (da->type == PW_TYPE_OCTETS)) { + if (da->type == PW_TYPE_STRING) { memcpy(buffer, data + 1, datalen - 1); tag = data[0]; datalen -= 1; - } else { + + } else if (da->type == PW_TYPE_INTEGER) { memcpy(buffer, data, attrlen); tag = buffer[0]; buffer[0] = 0; + + } else { + return -1; /* only string and integer can have tags */ } data = buffer;