diff options
author | Guy Harris <guy@alum.mit.edu> | 2001-07-16 06:09:02 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2001-07-16 06:09:02 +0000 |
commit | 30c935a72ec18076be5da1cd9ca7f6f68baf6118 (patch) | |
tree | 5383ac66d1b4b6a61f9a6ca7f01ee7a5c9d21f56 /packet-yhoo.c | |
parent | f338bd3ffc38c67fa51d7278615a80d9ed4e79cb (diff) | |
download | wireshark-30c935a72ec18076be5da1cd9ca7f6f68baf6118.tar.gz wireshark-30c935a72ec18076be5da1cd9ca7f6f68baf6118.tar.bz2 wireshark-30c935a72ec18076be5da1cd9ca7f6f68baf6118.zip |
Use "proto_tree_add_item()", not "proto_tree_add_string()" with a
"tvb_get_ptr()" call using the same offset and length as the
"proto_tree_add_string()" call, to add FT_STRING fields to the tree.
(The value argument to "proto_tree_add_string()" must be
null-terminated, and there's no guarantee that the string you get from
the "tvb_get_ptr()" call will be null-terminated;
"proto_tree_add_item()" with an FT_STRING field, however, will
null-terminate the value.)
Fix the length argument in the call for the last item in the Yahoo
Messenger tree.
svn path=/trunk/; revision=3729
Diffstat (limited to 'packet-yhoo.c')
-rw-r--r-- | packet-yhoo.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/packet-yhoo.c b/packet-yhoo.c index b671be2add..91b24b6ce0 100644 --- a/packet-yhoo.c +++ b/packet-yhoo.c @@ -2,7 +2,7 @@ * Routines for yahoo messenger packet dissection * Copyright 1999, Nathan Neulinger <nneul@umr.edu> * - * $Id: packet-yhoo.c,v 1.17 2001/07/03 04:56:46 guy Exp $ + * $Id: packet-yhoo.c,v 1.18 2001/07/16 06:09:02 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -154,44 +154,44 @@ dissect_yhoo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) tvb_length_remaining(tvb, offset), FALSE); yhoo_tree = proto_item_add_subtree(ti, ett_yhoo); - proto_tree_add_string(yhoo_tree, hf_yhoo_version, tvb, - offset, 8, tvb_get_ptr(tvb, offset, 8)); + proto_tree_add_item(yhoo_tree, hf_yhoo_version, tvb, + offset, 8, TRUE); offset += 8; - proto_tree_add_uint(yhoo_tree, hf_yhoo_len, tvb, - offset, 4, tvb_get_letohl(tvb, offset)); + proto_tree_add_item(yhoo_tree, hf_yhoo_len, tvb, + offset, 4, TRUE); offset += 4; - proto_tree_add_uint(yhoo_tree, hf_yhoo_service, tvb, - offset, 4, tvb_get_letohl(tvb, offset)); + proto_tree_add_item(yhoo_tree, hf_yhoo_service, tvb, + offset, 4, TRUE); offset += 4; - proto_tree_add_uint(yhoo_tree, hf_yhoo_connection_id, tvb, - offset, 4, tvb_get_letohl(tvb, offset)); + proto_tree_add_item(yhoo_tree, hf_yhoo_connection_id, tvb, + offset, 4, TRUE); offset += 4; - proto_tree_add_uint(yhoo_tree, hf_yhoo_magic_id, tvb, - offset, 4, tvb_get_letohl(tvb, offset)); + proto_tree_add_item(yhoo_tree, hf_yhoo_magic_id, tvb, + offset, 4, TRUE); offset += 4; - proto_tree_add_uint(yhoo_tree, hf_yhoo_unknown1, tvb, - offset, 4, tvb_get_letohl(tvb, offset)); + proto_tree_add_item(yhoo_tree, hf_yhoo_unknown1, tvb, + offset, 4, TRUE); offset += 4; - proto_tree_add_uint(yhoo_tree, hf_yhoo_msgtype, tvb, - offset, 4, tvb_get_letohl(tvb, offset)); + proto_tree_add_item(yhoo_tree, hf_yhoo_msgtype, tvb, + offset, 4, TRUE); offset += 4; - proto_tree_add_string(yhoo_tree, hf_yhoo_nick1, tvb, - offset, 36, tvb_get_ptr(tvb, offset, 36)); + proto_tree_add_item(yhoo_tree, hf_yhoo_nick1, tvb, + offset, 36, TRUE); offset += 36; - proto_tree_add_string(yhoo_tree, hf_yhoo_nick2, tvb, - offset, 36, tvb_get_ptr(tvb, offset, 36)); + proto_tree_add_item(yhoo_tree, hf_yhoo_nick2, tvb, + offset, 36, TRUE); offset += 36; - proto_tree_add_string(yhoo_tree, hf_yhoo_content, tvb, - offset, length, tvb_get_ptr(tvb, offset, length-offset)); + proto_tree_add_item(yhoo_tree, hf_yhoo_content, tvb, + offset, length-offset, TRUE); } return TRUE; |