The SIP2 protocol document specifies that variable fields are to be from
0 to 255 characters in length, not counting the field identifier or the
delimiter.
This branch adds some defensive coding to Sip::add_field to truncate any
field values that are longer than 255 characters to 255 characters before
adding them to the response.
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
substr($value, $i, 1) = $ent;
}
+ # SIP2 Protocol document specifies that variable fields are from 0
+ # to 255 characters in length. We'll do a check of the field
+ # length and truncate if necessary.
+ if (length($value) > 255) {
+ $value = substr($value, 0, 255);
+ }
+
return $field_id . $value . $field_delimiter;
}
#