aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-capwap.c
diff options
context:
space:
mode:
authorChris Maynard <Christopher.Maynard@GTECH.COM>2012-07-14 19:52:18 +0000
committerChris Maynard <Christopher.Maynard@GTECH.COM>2012-07-14 19:52:18 +0000
commit1ff8c1fcbaa77b2aab8146e0d2770eb4163792e9 (patch)
treec64f2247600d98e7472b29ba227cc2b10fedd2b7 /epan/dissectors/packet-capwap.c
parent590cec69620bf3b99d61fcf337e18d399235ff1d (diff)
Don't pass the return value of tvb_length_remaining() to fragment_add_check(), as it might have been -1.
Fixes Coverity CID 280510: Improper use of negative value. svn path=/trunk/; revision=43716
Diffstat (limited to 'epan/dissectors/packet-capwap.c')
-rw-r--r--epan/dissectors/packet-capwap.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/epan/dissectors/packet-capwap.c b/epan/dissectors/packet-capwap.c
index 3feaf036aa..3b19f4d059 100644
--- a/epan/dissectors/packet-capwap.c
+++ b/epan/dissectors/packet-capwap.c
@@ -1462,13 +1462,17 @@ dissect_capwap_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (global_capwap_reassemble && fragment_is)
{
+ gint len_rem = tvb_length_remaining(tvb, offset);
+ if (len_rem <= 0)
+ return;
+
pinfo->fragmented = TRUE;
frag_msg = fragment_add_check(tvb, offset, pinfo,fragment_id,
capwap_fragment_table,
capwap_reassembled_table,
fragment_offset,
- tvb_length_remaining(tvb, offset),
+ len_rem,
fragment_more);
next_tvb = process_reassembled_data(tvb, offset, pinfo,