diff options
author | Chris Maynard <Christopher.Maynard@GTECH.COM> | 2013-03-27 03:13:56 +0000 |
---|---|---|
committer | Chris Maynard <Christopher.Maynard@GTECH.COM> | 2013-03-27 03:13:56 +0000 |
commit | 8aa0a23246ce2bbf8b9e8bdf48b0b017562229ce (patch) | |
tree | 5b3ca9a8ffd600056b802e913ea4189ac5189c38 /epan/dissectors/packet-sip.c | |
parent | 05308f904d178451873ad6a22bbde16b09763069 (diff) |
tvb_reported_length_remaining() can return -1, so be sure to properly handle it if it does.
#BACKPORT(1.6, 1.8)
svn path=/trunk/; revision=48578
Diffstat (limited to 'epan/dissectors/packet-sip.c')
-rw-r--r-- | epan/dissectors/packet-sip.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/epan/dissectors/packet-sip.c b/epan/dissectors/packet-sip.c index 93dfe17336..ea622eeb68 100644 --- a/epan/dissectors/packet-sip.c +++ b/epan/dissectors/packet-sip.c @@ -2045,7 +2045,7 @@ dissect_sip_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) return; } - while (tvb_reported_length_remaining(tvb, offset) != 0) { + while (tvb_reported_length_remaining(tvb, offset) > 0) { len = dissect_sip_common(tvb, offset, pinfo, tree, TRUE, TRUE); if (len <= 0) break; @@ -2060,7 +2060,7 @@ dissect_sip_tcp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void * int len; gboolean first = TRUE; - while (tvb_reported_length_remaining(tvb, offset) != 0) { + while (tvb_reported_length_remaining(tvb, offset) > 0) { len = dissect_sip_common(tvb, offset, pinfo, tree, !first, TRUE); if (len == -2) { if (first) { @@ -2290,7 +2290,7 @@ dissect_sip_common(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tr } line_end_offset = offset + linelen; - if(tvb_reported_length_remaining(tvb, next_offset) == 0){ + if(tvb_reported_length_remaining(tvb, next_offset) <= 0){ is_no_header_termination = TRUE; }else{ while ((c = tvb_get_guint8(tvb, next_offset)) == ' ' || c == '\t') |