SIP: Fix parsing of multiple contact-param

contact-params are optional (s. https://tools.ietf.org/html/rfc3261#section-20.10).
Therefore, independently of contact-params, we should also check for additional contact-param.

Fixes: wireshark/wireshark#13752
This commit is contained in:
Uli Heilmeier 2021-01-01 21:09:02 +01:00 committed by Wireshark GitLab Utility
parent 132d725bdc
commit 02f2d18b2e
1 changed files with 7 additions and 6 deletions

View File

@ -2025,6 +2025,13 @@ dissect_sip_contact_item(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gi
/* Check if we have contact parameters, the uri should be followed by a ';' */
contact_params_start_offset = tvb_find_guint8(tvb, uri_offsets.uri_end, line_end_offset - uri_offsets.uri_end, ';');
if (queried_offset != -1 && (queried_offset < contact_params_start_offset || contact_params_start_offset == -1)) {
/* no expires param */
(*contacts_expires_unknown)++;
return queried_offset;
}
/* check if contact-params is present */
if(contact_params_start_offset == -1) {
/* no expires param */
@ -2032,12 +2039,6 @@ dissect_sip_contact_item(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gi
return line_end_offset;
}
if (queried_offset != -1 && queried_offset < contact_params_start_offset) {
/* no expires param */
(*contacts_expires_unknown)++;
return queried_offset;
}
/* Move current offset to the start of the first param */
contact_params_start_offset++;
current_offset = contact_params_start_offset;