diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2013-10-22 13:51:21 +0000 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2013-10-22 13:51:21 +0000 |
commit | d9b9ff60dfa0cb2bb7e3222a5aef499d2c4883a0 (patch) | |
tree | 363058e0bdd5299f43210559df4d4389953f4890 | |
parent | a93eb10ee91b7a601486aad6b4bd612d64e68db4 (diff) |
curr-num_layer is not always incremented by 1 when calling the subdissector
svn path=/trunk/; revision=52759
-rw-r--r-- | epan/dissectors/packet-udp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/epan/dissectors/packet-udp.c b/epan/dissectors/packet-udp.c index 5192e3d3be..123f78534f 100644 --- a/epan/dissectors/packet-udp.c +++ b/epan/dissectors/packet-udp.c @@ -327,12 +327,13 @@ decode_udp_ports(tvbuff_t *tvb, int offset, packet_info *pinfo, if (try_heuristic_first && prev_heur_found) { /* do lookup with the heuristic subdissector table */ + /* save curr_layer_num as it might be changed by subdissector */ + guint8 curr_layer_num = pinfo->curr_layer_num; if (dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, tree, NULL)) { if (!udp_p_info) { udp_p_info = wmem_new0(wmem_file_scope(), udp_p_info_t); udp_p_info->found_heuristic = TRUE; - /* pinfo->curr_layer_num-1 because the heuristic dissector added one */ - p_add_proto_data(pinfo->fd, hfi_udp->id, pinfo->curr_layer_num-1, udp_p_info); + p_add_proto_data(pinfo->fd, hfi_udp->id, curr_layer_num, udp_p_info); } return; } |