aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-capwap.c
diff options
context:
space:
mode:
authorcmaynard <cmaynard@f5534014-38df-0310-8fa8-9805f1628bb7>2012-07-14 19:52:18 +0000
committercmaynard <cmaynard@f5534014-38df-0310-8fa8-9805f1628bb7>2012-07-14 19:52:18 +0000
commit888c23d95493a397c9d10e9b05a70d2dd4a60041 (patch)
treec64f2247600d98e7472b29ba227cc2b10fedd2b7 /epan/dissectors/packet-capwap.c
parentb6b29b4c6a6954558d5fcdf3a0e5c287f8346938 (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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@43716 f5534014-38df-0310-8fa8-9805f1628bb7
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,