aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-rpc.c
diff options
context:
space:
mode:
authorJorge Mora <jmora1300@gmail.com>2020-08-07 10:40:06 -0600
committerAnders Broman <a.broman58@gmail.com>2020-08-12 07:18:40 +0000
commit9c1a55a5ae1db446934ce8a4ab33bfdfb45f320c (patch)
treed86940f423887789d4c2f42a811de69307a5981c /epan/dissectors/packet-rpc.c
parentbf9112445885951c0be121edbf9ed90b7bf3d037 (diff)
RPC: partially dissect GSS NFS truncated packets
Make sure to set the GSS Data subtree length properly when the packet has been truncated so at least the rest of the packet could be partially dissected. Change-Id: I0b41137aea47c2512d15d28ed620542decd31904 Reviewed-on: https://code.wireshark.org/review/38086 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-rpc.c')
-rw-r--r--epan/dissectors/packet-rpc.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/epan/dissectors/packet-rpc.c b/epan/dissectors/packet-rpc.c
index 29c4df7a27..79ec7bd033 100644
--- a/epan/dissectors/packet-rpc.c
+++ b/epan/dissectors/packet-rpc.c
@@ -1585,14 +1585,23 @@ dissect_rpc_authgss_integ_data(tvbuff_t *tvb, packet_info *pinfo,
dissector_handle_t dissect_function,
const char *progname, rpc_call_info_value *rpc_call)
{
+ gint reported_length, captured_length;
guint32 length, rounded_length, seq;
proto_tree *gtree;
+ reported_length = tvb_reported_length_remaining(tvb, offset);
+ captured_length = tvb_captured_length_remaining(tvb, offset);
length = tvb_get_ntohl(tvb, offset);
rounded_length = rpc_roundup(length);
seq = tvb_get_ntohl(tvb, offset+4);
+ if (captured_length < reported_length) {
+ /* Set rounded length so it does not croak while setting up the
+ * GSS Data subtree when the packet has been truncated so at
+ * least the rest of the packet could be partially dissected */
+ rounded_length = captured_length - 4;
+ }
gtree = proto_tree_add_subtree(tree, tvb, offset,
4+rounded_length, ett_rpc_gss_data, NULL, "GSS Data");
proto_tree_add_uint(gtree, hf_rpc_authgss_data_length,