RFC 2868 says that the length of a "tagged string" field must be at

least 3 - 2 for type+length and 1 for the tag - so treat a "tagged
string" field as bad if there isn't at least one byte of data.  (It's a
bit odd that the RFC says that the tag must be in the range 0x01-0x1F -
that sounds suspiciously as if they're saying "printable characters
aren't valid tags", to allow untagged strings, which might suggest that
a field with a length of 2 should be interpreted as an empty string.)

svn path=/trunk/; revision=12817
This commit is contained in:
Guy Harris 2004-12-22 19:27:09 +00:00
parent e501ee7f01
commit 9e176608c5
1 changed files with 8 additions and 8 deletions

View File

@ -3706,14 +3706,14 @@ static void rd_value_to_str(gchar *dest, rd_vsa_buffer (*vsabuffer)[VSABUFFER],
case( RADIUS_STRING_TAGGED ):
/* Tagged ? */
if (avph->avp_length > 2) {
tag = tvb_get_guint8(tvb,offset+2);
if (tag > 0 && tag <= 0x1f) {
sprintf(dest, "Tag:%u, Value:", tag);
cont=&cont[strlen(cont)];
rdconvertbufftostr(cont,tvb,offset+3,avph->avp_length-3);
break;
}
if (!avp_length_check(cont, avph, 1))
return;
tag = tvb_get_guint8(tvb,offset+2);
if (tag > 0 && tag <= 0x1f) {
sprintf(dest, "Tag:%u, Value:", tag);
cont=&cont[strlen(cont)];
rdconvertbufftostr(cont,tvb,offset+3,avph->avp_length-3);
break;
}
rdconvertbufftostr(cont,tvb,offset+2,avph->avp_length-2);
break;