aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2019-01-05 01:23:43 +0100
committerHarald Welte <laforge@osmocom.org>2020-09-11 23:28:01 +0200
commit4947ec41737e20cf2b6157e9703d144cba97c410 (patch)
tree398345cca62e57ed5c8c9ebc80f31ac291cdf12c
parent6957d53c6e82e27459c8d41b1da9243e35857847 (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);
}