aboutsummaryrefslogtreecommitdiffstats
path: root/packet-dcerpc-browser.c
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2002-05-30 10:06:58 +0000
committerRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2002-05-30 10:06:58 +0000
commit7f798e68ee637ee8c85c61746b64e2a9395b16cc (patch)
tree37f7ef98ddc52589fd4031f11283f543cb0ba491 /packet-dcerpc-browser.c
parent531cb17873359c47ac707c62946bb1b60c53be7c (diff)
Fixed bug when dissectors forgot to eat the array headers for conformant_run==1
resulting in an assert to abort ethereal. It shows that the assers worked and that it will find bugs and not allow the dissectors to misdissect the packets. svn path=/trunk/; revision=5601
Diffstat (limited to 'packet-dcerpc-browser.c')
-rw-r--r--packet-dcerpc-browser.c35
1 files changed, 28 insertions, 7 deletions
diff --git a/packet-dcerpc-browser.c b/packet-dcerpc-browser.c
index 959c92681d..f7f6d31203 100644
--- a/packet-dcerpc-browser.c
+++ b/packet-dcerpc-browser.c
@@ -2,7 +2,7 @@
* Routines for DCERPC Browser packet disassembly
* Copyright 2001, Ronnie Sahlberg
*
- * $Id: packet-dcerpc-browser.c,v 1.3 2002/05/28 13:59:20 sahlberg Exp $
+ * $Id: packet-dcerpc-browser.c,v 1.4 2002/05/30 10:06:58 sahlberg Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -96,13 +96,14 @@ dissect_browser_TYPE_4_data(tvbuff_t *tvb, int offset,
di=pinfo->private_data;
if(di->conformant_run){
- /*just a run to handle conformant arrays, nothing to dissect */
+ /* this call is to make ethereal eat the array header for the conformant run */
+ offset =dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep, NULL);
+
return offset;
}
-
- /* this is really the length of the encoded data */
offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
hf_browser_unknown_long, &len);
+
proto_tree_add_item(tree, hf_browser_unknown_bytes, tvb, offset, len,
FALSE);
offset += len;
@@ -141,7 +142,9 @@ dissect_browser_TYPE_3_data(tvbuff_t *tvb, int offset,
di=pinfo->private_data;
if(di->conformant_run){
- /*just a run to handle conformant arrays, nothing to dissect */
+ /* this call is to make ethereal eat the array header for the conformant run */
+ offset =dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep, NULL);
+
return offset;
}
@@ -183,6 +186,13 @@ dissect_browser_TYPE_2(tvbuff_t *tvb, int offset,
char *drep)
{
guint32 level;
+ dcerpc_info *di;
+
+ di=pinfo->private_data;
+ if(di->conformant_run){
+ /* ALING_TO_4_BYTES below might eat bytes otherwise */
+ return offset;
+ }
/* this is really the union switch arm */
offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
@@ -741,7 +751,9 @@ dissect_browser_TYPE_9_data(tvbuff_t *tvb, int offset,
di=pinfo->private_data;
if(di->conformant_run){
- /*just a run to handle conformant arrays, nothing to dissect */
+ /* this call is to make ethereal eat the array header for the conformant run */
+ offset =dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep, NULL);
+
return offset;
}
@@ -783,6 +795,13 @@ dissect_browser_TYPE_8(tvbuff_t *tvb, int offset,
char *drep)
{
guint32 level;
+ dcerpc_info *di;
+
+ di=pinfo->private_data;
+ if(di->conformant_run){
+ /* ALING_TO_4_BYTES below might eat bytes otherwise */
+ return offset;
+ }
/* this is really the union switch arm */
offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
@@ -927,7 +946,9 @@ dissect_browser_TYPE_12_data(tvbuff_t *tvb, int offset,
di=pinfo->private_data;
if(di->conformant_run){
- /*just a run to handle conformant arrays, nothing to dissect */
+ /* this call is to make ethereal eat the array header for the conformant run */
+ offset =dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep, NULL);
+
return offset;
}