aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2019-01-05 01:23:43 +0100
committerHarald Welte <laforge@gnumonks.org>2019-09-05 19:21:02 +0200
commitdc96b1f676e9a93e367379b471a1f20fa2652b90 (patch)
tree0c09b3218e383e340e83118301ecfb9969200cfe
parent5dd580b7f626b61b489d91fed80b0ced74af8f44 (diff)
dect-dlc: Don't call NWK dissector if there's no payload
-rw-r--r--epan/dissectors/packet-dect-dlc.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/epan/dissectors/packet-dect-dlc.c b/epan/dissectors/packet-dect-dlc.c
index c021cdb6ad..a10303d840 100644
--- a/epan/dissectors/packet-dect-dlc.c
+++ b/epan/dissectors/packet-dect-dlc.c
@@ -139,12 +139,14 @@ static int dissect_dect_dlc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
len = length >> 2;
available_length = tvb_captured_length(tvb) - 3;
- payload = tvb_new_subset_length_caplen(tvb, 3, MIN(len, available_length), len);
+ if (available_length > 0) {
+ payload = tvb_new_subset_length_caplen(tvb, 3, MIN(len, available_length), len);
- /* FIXME: fragment reassembly like in packet-lapdm.c */
+ /* FIXME: fragment reassembly like in packet-lapdm.c */
- if (!dissector_try_uint(dlc_sapi_dissector_table, sapi, payload, pinfo, tree))
- call_data_dissector(payload, pinfo, tree);
+ if (!dissector_try_uint(dlc_sapi_dissector_table, sapi, payload, pinfo, tree))
+ call_data_dissector(payload, pinfo, tree);
+ }
return tvb_captured_length(tvb);
}