aboutsummaryrefslogtreecommitdiffstats
path: root/packet-smb-pipe.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2002-11-16 09:37:15 +0000
committerGuy Harris <guy@alum.mit.edu>2002-11-16 09:37:15 +0000
commita6454699a172f9b2787025ef3e0515f0ae40e4d2 (patch)
treea6a79438d6c69862377e9e6c93e31e5888117b7c /packet-smb-pipe.c
parent6af38451a2ade7116aa214bdb46f4d2e0cb15d97 (diff)
When processing a response, handle the case where the parameter
descriptor of the matching request is missing, e.g. because the frame was too short but not so sort that the entire request was missing. Clean up the handling of the case where the parameter descriptor isn't missing but the data descriptor was. If we can't dissect the response data due to a missing descriptor, at least create *some* item for the data. svn path=/trunk/; revision=6645
Diffstat (limited to 'packet-smb-pipe.c')
-rw-r--r--packet-smb-pipe.c85
1 files changed, 67 insertions, 18 deletions
diff --git a/packet-smb-pipe.c b/packet-smb-pipe.c
index 1ed7cc4e70..053f967231 100644
--- a/packet-smb-pipe.c
+++ b/packet-smb-pipe.c
@@ -8,7 +8,7 @@ XXX Fixme : shouldnt show [malformed frame] for long packets
* significant rewrite to tvbuffify the dissector, Ronnie Sahlberg and
* Guy Harris 2001
*
- * $Id: packet-smb-pipe.c,v 1.83 2002/10/24 06:17:34 guy Exp $
+ * $Id: packet-smb-pipe.c,v 1.84 2002/11/16 09:37:15 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -2493,11 +2493,19 @@ dissect_response_data(tvbuff_t *tvb, packet_info *pinfo, int convert,
* TCP desegmentation, or if we had a snapshot
* length that was too short.
*
- * We can't dissect the data; just show it
- * as raw data.
+ * We can't dissect the data; just show it as raw data or,
+ * if we've already created a top-level item, note that
+ * no descriptor is available.
*/
- proto_tree_add_text(tree, tvb, offset, -1,
- "Data (no descriptor available)");
+ if (has_ent_count) {
+ if (data_item != NULL) {
+ proto_item_append_text(data_item,
+ " (No descriptor available)");
+ }
+ } else {
+ proto_tree_add_text(data_tree, tvb, offset, -1,
+ "Data (no descriptor available)");
+ }
offset += tvb_length_remaining(tvb, offset);
} else {
/*
@@ -2782,22 +2790,63 @@ dissect_pipe_lanman(tvbuff_t *pd_tvb, tvbuff_t *p_tvb, tvbuff_t *d_tvb,
proto_tree_add_uint(tree, hf_convert, p_tvb, offset, 2, convert);
offset += 2;
- /* rest of the parameters */
- offset = dissect_response_parameters(p_tvb, offset, pinfo, tree,
- trp->param_descrip, lanman->resp, &has_data,
- &has_ent_count, &ent_count);
+ if (trp->param_descrip == NULL) {
+ /*
+ * This could happen if we only dissected
+ * part of the request to which this is a
+ * reply, e.g. if the request was split
+ * across TCP segments and we weren't doing
+ * TCP desegmentation, or if we had a snapshot
+ * length that was too short.
+ *
+ * We can't dissect the parameters; just show them
+ * as raw data.
+ */
+ proto_tree_add_text(tree, p_tvb, offset, -1,
+ "Parameters (no descriptor available)");
- /* reset offset, we now start dissecting the data area */
- offset = 0;
- /* data */
- if (has_data && d_tvb && tvb_reported_length(d_tvb) > 0) {
/*
- * There's a receive buffer item in the descriptor
- * string, and the data count in the transaction
- * is non-zero, so there's data to dissect.
+ * We don't know whether we have a receive buffer,
+ * as we don't have the descriptor; just show what
+ * bytes purport to be data.
*/
- dissect_response_data(d_tvb, pinfo, convert, tree,
- smb_info, lanman, has_ent_count, ent_count);
+ if (d_tvb && tvb_reported_length(d_tvb) > 0) {
+ proto_tree_add_text(tree, d_tvb, 0, -1,
+ "Data (no descriptor available)");
+ }
+ } else {
+ /* rest of the parameters */
+ offset = dissect_response_parameters(p_tvb, offset,
+ pinfo, tree, trp->param_descrip, lanman->resp,
+ &has_data, &has_ent_count, &ent_count);
+
+ /* reset offset, we now start dissecting the data area */
+ offset = 0;
+ /* data */
+ if (d_tvb && tvb_reported_length(d_tvb) > 0) {
+ /*
+ * Well, there are bytes that purport to
+ * be data, at least.
+ */
+ if (has_data) {
+ /*
+ * There's a receive buffer item
+ * in the descriptor string, so
+ * dissect it as response data.
+ */
+ dissect_response_data(d_tvb, pinfo,
+ convert, tree, smb_info, lanman,
+ has_ent_count, ent_count);
+ } else {
+ /*
+ * There's no receive buffer item,
+ * but we do have data, so just
+ * show what bytes are data.
+ */
+ proto_tree_add_text(tree, d_tvb, 0, -1,
+ "Data (no receive buffer)");
+ }
+ }
}
}