diff options
author | Anders Broman <anders.broman@ericsson.com> | 2011-11-15 20:14:51 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2011-11-15 20:14:51 +0000 |
commit | 8921bb17b56f25666e81fa4de63d35a14db8738b (patch) | |
tree | ca37548331c4a19f77d078d89ab7f23adb034311 | |
parent | 519b219ae8ae33c4756252be7ba8ea356125dc2b (diff) | |
download | wireshark-8921bb17b56f25666e81fa4de63d35a14db8738b.tar.gz |
Check the return value of dissect_sip_name_addr_or_addr_spec()
Should fix the recent fuzz failures.
Thanks Chris for isolating the offending packet.
svn path=/trunk/; revision=39867
-rw-r--r-- | epan/dissectors/packet-sip.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/epan/dissectors/packet-sip.c b/epan/dissectors/packet-sip.c index 720f7c3274..c06a6065c0 100644 --- a/epan/dissectors/packet-sip.c +++ b/epan/dissectors/packet-sip.c @@ -1481,12 +1481,13 @@ dissect_sip_contact_item(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gi sip_uri_offset_init(&uri_offsets); /* contact-param = (name-addr / addr-spec) *(SEMI contact-params) */ current_offset = dissect_sip_name_addr_or_addr_spec(tvb, pinfo, start_offset, line_end_offset, &uri_offsets); - display_sip_uri(tvb, tree, &uri_offsets, &sip_contact_uri); if(current_offset == -1) { /* Parsing failed */ return -1; } + display_sip_uri(tvb, tree, &uri_offsets, &sip_contact_uri); + /* 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 */ @@ -1700,6 +1701,8 @@ static void dissect_sip_route_header(tvbuff_t *tvb, proto_tree *tree, packet_inf if (c == ',') { sip_uri_offset_init(&uri_offsets); current_offset = dissect_sip_name_addr_or_addr_spec(tvb, pinfo, start_offset, current_offset, &uri_offsets); + if(current_offset == -1) + return; display_sip_uri(tvb, tree, &uri_offsets, sip_route_uri); current_offset++; @@ -1708,6 +1711,8 @@ static void dissect_sip_route_header(tvbuff_t *tvb, proto_tree *tree, packet_inf } else if (current_offset == line_end_offset - 1) { sip_uri_offset_init(&uri_offsets); current_offset = dissect_sip_name_addr_or_addr_spec(tvb, pinfo, start_offset, line_end_offset, &uri_offsets); + if(current_offset == -1) + return; display_sip_uri(tvb, tree, &uri_offsets, sip_route_uri); return; |