aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorSake Blok <sake@euronet.nl>2008-04-15 22:53:34 +0000
committerSake Blok <sake@euronet.nl>2008-04-15 22:53:34 +0000
commit1984f23e28a19333fa4b3ae7e8e1aba7971fe2ab (patch)
treec4dede6405fd7f4b3613369dc01849844ea22c11 /epan
parent5a8e585962367d944c31df0f7fc8d8baa39962b4 (diff)
Fix for the "Malformed packet: RPC" that is encountered in bug 1392:
Don't call a RPC subdissector if there is no more data in the packet. svn path=/trunk/; revision=25058
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-rpc.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/epan/dissectors/packet-rpc.c b/epan/dissectors/packet-rpc.c
index 9e20a0a2ca..a38f64ee9a 100644
--- a/epan/dissectors/packet-rpc.c
+++ b/epan/dissectors/packet-rpc.c
@@ -2488,6 +2488,13 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
return TRUE;
}
+ /* we must queue this packet to the tap system before we actually
+ call the subdissectors since short packets (i.e. nfs read reply)
+ will cause an exception and execution would never reach the call
+ to tap_queue_packet() in that case
+ */
+ tap_queue_packet(rpc_tap, pinfo, rpc_call);
+
/* create here the program specific sub-tree */
if (tree && (flavor != FLAVOR_AUTHGSSAPI_MSG)) {
pitem = proto_tree_add_item(tree, proto_id, tvb, offset, -1,
@@ -2523,18 +2530,18 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
}
- /* we must queue this packet to the tap system before we actually
- call the subdissectors since short packets (i.e. nfs read reply)
- will cause an exception and execution would never reach the call
- to tap_queue_packet() in that case
- */
- tap_queue_packet(rpc_tap, pinfo, rpc_call);
-
/* proto==0 if this is an unknown program */
if( (proto==0) || !proto_is_protocol_enabled(proto)){
dissect_function = NULL;
}
+ /*
+ * Don't call any subdissector if we have no more date to dissect.
+ */
+ if (tvb_length_remaining(tvb, offset) == 0) {
+ return TRUE;
+ }
+
/*
* Handle RPCSEC_GSS and AUTH_GSSAPI specially.
*/