OSITP: do not call subdissector if there is no data

None of the current heuristics dissectors for "cotp" accept the packet,
so just skip calling subdissectors if the packet is empty.

Change-Id: Ie26f05d472b4d184d5229ceab8b143a88cc921fc
Reviewed-on: https://code.wireshark.org/review/30103
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Émilio Gonzalez <egg997@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Peter Wu 2018-10-09 21:25:35 +02:00 committed by Anders Broman
parent 8c31cdc13c
commit 1a9f074c0c
1 changed files with 13 additions and 11 deletions

View File

@ -1576,19 +1576,21 @@ static int ositp_decode_CR_CC(tvbuff_t *tvb, int offset, guint8 li, guint8 tpdu,
* XXX - tell the subdissector that this is user data in a CR or * XXX - tell the subdissector that this is user data in a CR or
* CC packet rather than a DT packet? * CC packet rather than a DT packet?
*/ */
next_tvb = tvb_new_subset_remaining(tvb, offset); if (tvb_captured_length_remaining(tvb, offset)) {
if (!uses_inactive_subset){ next_tvb = tvb_new_subset_remaining(tvb, offset);
if (dissector_try_heuristic(cotp_heur_subdissector_list, next_tvb, pinfo, if (!uses_inactive_subset){
tree, &hdtbl_entry, NULL)) { if (dissector_try_heuristic(cotp_heur_subdissector_list, next_tvb, pinfo,
*subdissector_found = TRUE; tree, &hdtbl_entry, NULL)) {
} else { *subdissector_found = TRUE;
call_data_dissector(next_tvb, pinfo, tree); } else {
call_data_dissector(next_tvb, pinfo, tree);
}
} }
else
call_data_dissector( next_tvb, pinfo, tree);
offset += tvb_captured_length_remaining(tvb, offset);
/* we dissected all of the containing PDU */
} }
else
call_data_dissector( next_tvb, pinfo, tree);
offset += tvb_captured_length_remaining(tvb, offset);
/* we dissected all of the containing PDU */
return offset; return offset;