summaryrefslogtreecommitdiff
path: root/epan/dissectors/packet-dcp-etsi.c
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss.ws@gmail.com>2012-08-03 16:20:31 +0000
committerJeff Morriss <jeff.morriss.ws@gmail.com>2012-08-03 16:20:31 +0000
commitba3db780d12ea7864575958d1f6d0b7a80cc5549 (patch)
tree90fdf24bc1ccddac5fa7b0cfd4c88f8bceaed828 /epan/dissectors/packet-dcp-etsi.c
parente9ebe32dfd81ee73a9c272995d2054ed259e168b (diff)
downloadwireshark-ba3db780d12ea7864575958d1f6d0b7a80cc5549.tar.gz
Fix fuzz failure reported in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7566 :
Don't try to reassemble a message of length 0 (fixes a later divide-by-zero error but I don't see why we'd want to do any work for message whose length we think is 0). svn path=/trunk/; revision=44247
Diffstat (limited to 'epan/dissectors/packet-dcp-etsi.c')
-rw-r--r--epan/dissectors/packet-dcp-etsi.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/epan/dissectors/packet-dcp-etsi.c b/epan/dissectors/packet-dcp-etsi.c
index f33d28fc6e..cacafdaaf3 100644
--- a/epan/dissectors/packet-dcp-etsi.c
+++ b/epan/dissectors/packet-dcp-etsi.c
@@ -511,14 +511,13 @@ dissect_pft(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
gboolean save_fragmented = pinfo->fragmented;
guint16 real_len = tvb_length(tvb)-offset;
proto_tree_add_item (pft_tree, hf_edcp_pft_payload, tvb, offset, real_len, ENC_NA);
- if(real_len != payload_len) {
+ if(real_len != payload_len || real_len == 0) {
if(li)
proto_item_append_text(li, " (length error (%d))", real_len);
}
- next_tvb = dissect_pft_fragmented(tvb, pinfo, pft_tree,
- findex, fcount, seq, offset, real_len,
- fec, rsk, rsz
- );
+ if (real_len)
+ next_tvb = dissect_pft_fragmented(tvb, pinfo, pft_tree, findex, fcount,
+ seq, offset, real_len, fec, rsk, rsz);
pinfo->fragmented = save_fragmented;
} else {
next_tvb = tvb_new_subset_remaining (tvb, offset);