diff options
author | jake <jake@f5534014-38df-0310-8fa8-9805f1628bb7> | 2009-09-22 05:49:15 +0000 |
---|---|---|
committer | jake <jake@f5534014-38df-0310-8fa8-9805f1628bb7> | 2009-09-22 05:49:15 +0000 |
commit | 1ce1470f2d9058bc3ec87b3a5cd06f998cdbe6a4 (patch) | |
tree | 6c892ce0b3e0a834461c4ec3717a4c7ece5e7fe5 /epan/dissectors/packet-cip.c | |
parent | fee20702727371675fb1098bf5a55c75e369e04e (diff) |
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().
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@30061 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-cip.c')
-rw-r--r-- | epan/dissectors/packet-cip.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/epan/dissectors/packet-cip.c b/epan/dissectors/packet-cip.c index cfaeed7ec2..a330e419c7 100644 --- a/epan/dissectors/packet-cip.c +++ b/epan/dissectors/packet-cip.c @@ -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); } } |