aboutsummaryrefslogtreecommitdiffstats
path: root/packet-giop.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2003-02-13 23:18:59 +0000
committerGuy Harris <guy@alum.mit.edu>2003-02-13 23:18:59 +0000
commit2a3681db955fe4422946e89e0cc3e5c8daa04ba0 (patch)
tree3aa3032bb57433ddf32f7c33b2beddd754bb8d5d /packet-giop.c
parentacf70fe5356699d5e9e048e51b4051020c47f739 (diff)
From Craig Rodrigues and Bernd Becker (merger of their patches, from
Craig): - correct bitmask for hf_giop_iop_vscid and hf_giop_iop_scid, reflecting the change to a 24bit vendor id and 8 bit service id - set the length of the "Service Context List" tree correctly after dissecting. The length was just being set to the end of the tvb - do not exit the loop through the Service Context List with return if the sequence length is 0, continue the loop instead. This should fix a problem reported by Mika Korpela. (see http://www.ethereal.com/lists/ethereal-dev/200205/msg00234.html) svn path=/trunk/; revision=7141
Diffstat (limited to 'packet-giop.c')
-rw-r--r--packet-giop.c43
1 files changed, 27 insertions, 16 deletions
diff --git a/packet-giop.c b/packet-giop.c
index 7fecad838e..e1f847b63c 100644
--- a/packet-giop.c
+++ b/packet-giop.c
@@ -9,7 +9,7 @@
* Frank Singleton <frank.singleton@ericsson.com>
* Trevor Shepherd <eustrsd@am1.ericsson.se>
*
- * $Id: packet-giop.c,v 1.66 2003/02/13 01:23:35 guy Exp $
+ * $Id: packet-giop.c,v 1.67 2003/02/13 23:18:59 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -4185,13 +4185,13 @@ proto_register_giop (void)
{ &hf_giop_iop_vscid,
{ "VSCID", "giop.iiop.vscid",
- FT_UINT32, BASE_HEX, NULL, 0xfffff000, "", HFILL }
+ FT_UINT32, BASE_HEX, NULL, 0xffffff00, "", HFILL }
}
,
{ &hf_giop_iop_scid,
{ "SCID", "giop.iiop.scid",
- FT_UINT32, BASE_HEX, NULL, 0x00000fff, "", HFILL }
+ FT_UINT32, BASE_HEX, NULL, 0x000000ff, "", HFILL }
}
,
@@ -4718,7 +4718,7 @@ void decode_ServiceContextList(tvbuff_t *tvb, proto_tree *ptree, int *offset,
proto_tree *tree = NULL; /* ServiceContext tree */
proto_tree *sub_tree1 = NULL;
- proto_item *tf, *tf_st1;
+ proto_item *tf = NULL, *tf_st1;
guint32 context_id;
@@ -4729,17 +4729,20 @@ void decode_ServiceContextList(tvbuff_t *tvb, proto_tree *ptree, int *offset,
gboolean encapsulation_is_be;
guint32 encapsulation_boundary;
int temp_offset;
+ int start_offset = *offset;
/* create a subtree */
if (ptree) {
- tf = proto_tree_add_text (ptree, tvb, *offset, -1, "ServiceContextList");
+ /* set length to 0 now and correct with proto_item_set_len() later */
+ tf = proto_tree_add_text (ptree, tvb, *offset, 0, "ServiceContextList");
+
tree = proto_item_add_subtree (tf, ett_giop_scl);
}
/* Get sequence length (number of elements) */
-
seqlen = get_CDR_ulong(tvb,offset,stream_is_be,boundary);
+
if (tree) {
proto_tree_add_uint(tree,hf_giop_sequence_length,tvb,
*offset-sizeof(seqlen),4,seqlen);
@@ -4747,15 +4750,19 @@ void decode_ServiceContextList(tvbuff_t *tvb, proto_tree *ptree, int *offset,
/* return if zero length sequence */
- if(seqlen == 0)
+ if (seqlen == 0) {
+ if (tf)
+ proto_item_set_len(tf, *offset - start_offset);
+
return;
+ }
/* Loop for all ServiceContext's */
for (i=0; i<seqlen; i++) {
context_id = get_CDR_ulong(tvb,offset,stream_is_be,boundary);
- vscid = context_id & 0xffffff00; /* vendor info, top 24 bits */
+ vscid = (context_id & 0xffffff00) >> 8; /* vendor info, top 24 bits */
scid = context_id & 0x000000ff; /* standard service info, lower 8 bits */
service_context_name = match_strval(scid, service_context_ids);
@@ -4773,21 +4780,22 @@ void decode_ServiceContextList(tvbuff_t *tvb, proto_tree *ptree, int *offset,
if( vscid != 0 || scid > max_service_context_id ) {
decode_UnknownServiceContext(tvb, tree, offset, stream_is_be, boundary,
vscid, scid);
- return;
- }
-
- if (tree) {
- tf_st1 = proto_tree_add_text (tree, tvb, *offset, -1, service_context_name);
- sub_tree1 = proto_item_add_subtree (tf_st1, ett_giop_scl_st1);
+ continue;
}
+ temp_offset = *offset;
/* get sequence length, new endianness and boundary for encapsulation */
seqlen_cd = get_CDR_encap_info(tvb, sub_tree1, offset,
stream_is_be, boundary,
&encapsulation_is_be , &encapsulation_boundary);
+ if (tree) {
+ tf_st1 = proto_tree_add_text (tree, tvb, temp_offset, sizeof(seqlen_cd) + seqlen_cd , service_context_name);
+ sub_tree1 = proto_item_add_subtree (tf_st1, ett_giop_scl_st1);
+ }
+
if (seqlen_cd == 0)
- return;
+ continue;
/* See CORBA 3.0.2 standard, section Section 15.3.3 "Encapsulation",
* for how CDR types can be marshalled into a sequence<octet>.
@@ -4809,7 +4817,10 @@ void decode_ServiceContextList(tvbuff_t *tvb, proto_tree *ptree, int *offset,
break;
}
- } /* seqlen */
+ } /* for seqlen */
+
+ if (tf)
+ proto_item_set_len(tf, *offset - start_offset);
}