From Julian Fielding:

Function dissect_epath() expects path_length in bytes, but the value from the 
packet is in words, so there's lots of *2 and /2 in those parts of the code.
In this invocation dissect_epath( tvbIOI, pi, 0, preq_info->IOILen, TRUE );
preq_info->IOILen is in words.

In six places proto_tree_add_item is used with tvb NULL and size 0 to add an
FT_UINT8/16/32 item. I think it should be replaced with proto_tree_add_uint().

svn path=/trunk/; revision=30061
This commit is contained in:
Jaap Keuter 2009-09-22 05:49:15 +00:00
parent 054ef7aa0f
commit f4b9554a27
1 changed files with 7 additions and 7 deletions

View File

@ -864,7 +864,7 @@ dissect_epath( tvbuff_t *tvb, proto_item *epath_item, int offset, int path_lengt
/* Display the 8-bit attribute number */
if ( generate )
{
it = proto_tree_add_item( cia_tree, hf_cip_member8, NULL, 0, 0, TRUE );
it = proto_tree_add_uint( cia_tree, hf_cip_member8, NULL, 0, 0, temp_data );
PROTO_ITEM_SET_GENERATED(it);
}
else
@ -891,7 +891,7 @@ dissect_epath( tvbuff_t *tvb, proto_item *epath_item, int offset, int path_lengt
/* Display the 16-bit attribute number */
if ( generate )
{
it = proto_tree_add_item( cia_tree, hf_cip_member16, NULL, 0, 0, TRUE );
it = proto_tree_add_uint( cia_tree, hf_cip_member16, NULL, 0, 0, temp_data );
PROTO_ITEM_SET_GENERATED(it);
}
else
@ -918,7 +918,7 @@ dissect_epath( tvbuff_t *tvb, proto_item *epath_item, int offset, int path_lengt
/* Display the 32-bit attribute number */
if ( generate )
{
it = proto_tree_add_item( cia_tree, hf_cip_member32, NULL, 0, 0, TRUE );
it = proto_tree_add_uint( cia_tree, hf_cip_member32, NULL, 0, 0, temp_data );
PROTO_ITEM_SET_GENERATED(it);
}
else
@ -957,7 +957,7 @@ dissect_epath( tvbuff_t *tvb, proto_item *epath_item, int offset, int path_lengt
/* Display the 8-bit attribute number */
if ( generate )
{
it = proto_tree_add_item( cia_tree, hf_cip_attribute8, NULL, 0, 0, TRUE );
it = proto_tree_add_uint( cia_tree, hf_cip_attribute8, NULL, 0, 0, temp_data );
PROTO_ITEM_SET_GENERATED(it);
}
else
@ -984,7 +984,7 @@ dissect_epath( tvbuff_t *tvb, proto_item *epath_item, int offset, int path_lengt
/* Display the 16-bit attribute number */
if ( generate )
{
it = proto_tree_add_item( cia_tree, hf_cip_attribute16, NULL, 0, 0, TRUE );
it = proto_tree_add_uint( cia_tree, hf_cip_attribute16, NULL, 0, 0, temp_data );
PROTO_ITEM_SET_GENERATED(it);
}
else
@ -1011,7 +1011,7 @@ dissect_epath( tvbuff_t *tvb, proto_item *epath_item, int offset, int path_lengt
/* Display the 32-bit attribute number */
if ( generate )
{
it = proto_tree_add_item( cia_tree, hf_cip_attribute32, NULL, 0, 0, TRUE );
it = proto_tree_add_uint( cia_tree, hf_cip_attribute32, NULL, 0, 0, temp_data );
PROTO_ITEM_SET_GENERATED(it);
}
else
@ -2645,7 +2645,7 @@ dissect_cip_data( proto_tree *item_tree, tvbuff_t *tvb, int offset, packet_info
/* Add the epath */
pi = proto_tree_add_text(cip_tree, NULL, 0, 0, "Request Path: ");
PROTO_ITEM_SET_GENERATED(pi);
dissect_epath( tvbIOI, pi, 0, preq_info->IOILen, TRUE );
dissect_epath( tvbIOI, pi, 0, preq_info->IOILen*2, TRUE );
tvb_free(tvbIOI);
}
}