forked from osmocom/wireshark
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
(cherry picked from commit 02f2d18b2e
)
This commit is contained in:
parent
a666035948
commit
75c00f6d0d
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue