diff options
author | Guy Harris <guy@alum.mit.edu> | 2017-12-03 22:12:23 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2017-12-04 06:13:00 +0000 |
commit | 7a957952dc03cd0283a7e8a9fc8ff1daaf012713 (patch) | |
tree | 8559d3452fd67660a99aa6ca5475fc5110ca7a34 | |
parent | 3944f881f4fea1c7e94ed77d5723a41f495c880b (diff) |
Let a "past the on-the-network length" exception terminate dissection.
Don't make sure we have the full server entry before trying to dissect
it; that way, a malformed frame that was really too short on the network
(as opposed to being cut short by a snapshot length) will get reported
as such.
Change-Id: Ib7f0d909645a698162ebcd9b3fe8dd2d520983b7
Reviewed-on: https://code.wireshark.org/review/24696
Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rw-r--r-- | epan/dissectors/packet-ipx.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/epan/dissectors/packet-ipx.c b/epan/dissectors/packet-ipx.c index b13647cad7..cee05e9fa1 100644 --- a/epan/dissectors/packet-ipx.c +++ b/epan/dissectors/packet-ipx.c @@ -886,8 +886,8 @@ dissect_ipxrip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _ proto_tree *rip_tree; proto_item *ti, *hidden_item; guint16 operation, ticks; - int cursor; - int available_length; + guint cursor; + guint available_length; col_set_str(pinfo->cinfo, COL_PROTOCOL, "IPX RIP"); col_clear(pinfo->cinfo, COL_INFO); @@ -1213,7 +1213,7 @@ dissect_ipxsap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _ { proto_tree *sap_tree, *s_tree; proto_item *ti, *hidden_item; - int cursor; + guint cursor; struct sap_query query; col_set_str(pinfo->cinfo, COL_PROTOCOL, "IPX SAP"); @@ -1251,8 +1251,8 @@ dissect_ipxsap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _ if (query.query_type == IPX_SAP_GENERAL_RESPONSE || query.query_type == IPX_SAP_NEAREST_RESPONSE) { /* responses */ - int available_length = tvb_reported_length(tvb); - for (cursor = 2; (cursor + 64) <= available_length; cursor += 64) { + guint available_length = tvb_reported_length(tvb); + for (cursor = 2; cursor <= available_length; cursor += 64) { const guint8 *server_name; ti = proto_tree_add_item(sap_tree, hf_sap_server, tvb, cursor, 64, ENC_NA); |