aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-sip.c
diff options
context:
space:
mode:
authorUli Heilmeier <uh@heilmeier.eu>2021-01-01 21:09:02 +0100
committerWireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2021-01-13 09:11:59 +0000
commit02f2d18b2ee6dbb650193689b0d4ed2d01566426 (patch)
tree02192dd565d3769ba7b4aa2b02a1e727da5b95f0 /epan/dissectors/packet-sip.c
parent132d725bdc304947827fbfa77dd7458d45bdb81f (diff)
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
Diffstat (limited to 'epan/dissectors/packet-sip.c')
-rw-r--r--epan/dissectors/packet-sip.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/epan/dissectors/packet-sip.c b/epan/dissectors/packet-sip.c
index d375902c91..8f68638f9e 100644
--- a/epan/dissectors/packet-sip.c
+++ b/epan/dissectors/packet-sip.c
@@ -2025,17 +2025,18 @@ 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, ';');
- /* check if contact-params is present */
- if(contact_params_start_offset == -1) {
+
+ if (queried_offset != -1 && (queried_offset < contact_params_start_offset || contact_params_start_offset == -1)) {
/* no expires param */
(*contacts_expires_unknown)++;
- return line_end_offset;
+ return queried_offset;
}
- if (queried_offset != -1 && queried_offset < contact_params_start_offset) {
+ /* check if contact-params is present */
+ if(contact_params_start_offset == -1) {
/* no expires param */
(*contacts_expires_unknown)++;
- return queried_offset;
+ return line_end_offset;
}
/* Move current offset to the start of the first param */