aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-sip.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2011-11-11 19:07:11 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2011-11-11 19:07:11 +0000
commitf46807ae77eb5fc90e7b582dd3a2e490c4d2a1c2 (patch)
treeefc9ca8842b844ea5caff764840526d30d15514a /epan/dissectors/packet-sip.c
parentff3a21cd123369513470b52cad962899c6655607 (diff)
Add some checks for "character not found"; this should fix some
fuzz-testing failures we're seeing. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39795 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-sip.c')
-rw-r--r--epan/dissectors/packet-sip.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/epan/dissectors/packet-sip.c b/epan/dissectors/packet-sip.c
index 177c4b27df..910f5120ae 100644
--- a/epan/dissectors/packet-sip.c
+++ b/epan/dissectors/packet-sip.c
@@ -1452,7 +1452,7 @@ dissect_sip_authorization_item(tvbuff_t *tvb, proto_tree *tree, gint start_offse
current_offset = start_offset;
equals_offset = tvb_find_guint8(tvb, current_offset + 1, line_end_offset - (current_offset + 1), '=');
- if(current_offset == -1){
+ if(equals_offset == -1){
/* malformed parameter */
return -1;
}
@@ -1484,6 +1484,10 @@ found:
}else if(c=='"'){
/* Do we have a quoted string ? */
queried_offset = tvb_find_guint8(tvb, queried_offset+1, line_end_offset - queried_offset, '"');
+ if(queried_offset==-1){
+ /* We have an opening quote but no closing quote. */
+ queried_offset = line_end_offset;
+ }
current_offset = tvb_find_guint8(tvb, queried_offset+1, line_end_offset - queried_offset, ',');
if(current_offset==-1){
/* Last parameter, line end */