aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ip.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2015-07-13 00:32:57 -0400
committerMichael Mann <mmann78@netscape.net>2015-07-14 03:48:34 +0000
commit1d708cef72dc230f58a9ed046a6a27355d98de1c (patch)
tree24ee0d179e616c6451c140d2b7e1f9484aac6590 /epan/dissectors/packet-ip.c
parent2ebe8792f9999b969581a0d719c50ec108d65568 (diff)
If the IP length says there no data following the IP layer, don't try to dissect the next layer.
Bug: 11354 Change-Id: I24a6f2b04e138902fb548ca500af35b18f08acdc Reviewed-on: https://code.wireshark.org/review/9619 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-ip.c')
-rw-r--r--epan/dissectors/packet-ip.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/epan/dissectors/packet-ip.c b/epan/dissectors/packet-ip.c
index 2155a6fce2..ea0c9f15e5 100644
--- a/epan/dissectors/packet-ip.c
+++ b/epan/dissectors/packet-ip.c
@@ -2442,6 +2442,7 @@ dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
return;
}
+ if (tvb_reported_length(next_tvb) > 0) {
/* Hand off to the next protocol.
XXX - setting the columns only after trying various dissectors means
@@ -2449,13 +2450,14 @@ dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
even be labeled as an IP frame; ideally, if a frame being dissected
throws an exception, it'll be labeled as a mangled frame of the
type in question. */
- if (!ip_try_dissect(try_heuristic_first, next_tvb, pinfo, parent_tree, iph)) {
- /* Unknown protocol */
- if (update_col_info) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s (%u)",
+ if (!ip_try_dissect(try_heuristic_first, next_tvb, pinfo, parent_tree, iph)) {
+ /* Unknown protocol */
+ if (update_col_info) {
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s (%u)",
ipprotostr(iph->ip_p), iph->ip_p);
+ }
+ call_dissector(data_handle,next_tvb, pinfo, parent_tree);
}
- call_dissector(data_handle,next_tvb, pinfo, parent_tree);
}
pinfo->fragmented = save_fragmented;
}