summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wu <lekensteyn@gmail.com>2014-02-10 12:51:43 +0100
committerPeter Wu <lekensteyn@gmail.com>2014-02-10 12:51:43 +0100
commit54240ab2dfa9ec95aedad10135fe80d6a6118e69 (patch)
tree0e686f47143c0c15a3b2bc352927e94a8b9b6796
parentc234f2db5c2f9a6e046829107d538b2495a39d62 (diff)
downloadwireshark-proto-coc.tar.gz
coc: Do not add a zero-length itemproto-coc
-rw-r--r--epan/dissectors/packet-coc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/epan/dissectors/packet-coc.c b/epan/dissectors/packet-coc.c
index e447861ecd..6812878f17 100644
--- a/epan/dissectors/packet-coc.c
+++ b/epan/dissectors/packet-coc.c
@@ -142,7 +142,8 @@ dissect_coc_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset += 3;
proto_tree_add_item(coc_tree, hf_coc_other, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
- proto_tree_add_item(coc_tree, hf_coc_data, tvb, offset, data_len, ENC_NA);
+ if (data_len)
+ proto_tree_add_item(coc_tree, hf_coc_data, tvb, offset, data_len, ENC_NA);
return tvb_length(tvb);
}