aboutsummaryrefslogtreecommitdiffstats
path: root/packet-zebra.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-07-16 06:09:02 +0000
committerGuy Harris <guy@alum.mit.edu>2001-07-16 06:09:02 +0000
commit30c935a72ec18076be5da1cd9ca7f6f68baf6118 (patch)
tree5383ac66d1b4b6a61f9a6ca7f01ee7a5c9d21f56 /packet-zebra.c
parentf338bd3ffc38c67fa51d7278615a80d9ed4e79cb (diff)
downloadwireshark-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-zebra.c')
-rw-r--r--packet-zebra.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/packet-zebra.c b/packet-zebra.c
index 11bc950ec9..e569938349 100644
--- a/packet-zebra.c
+++ b/packet-zebra.c
@@ -3,12 +3,11 @@
*
* Jochen Friedrich <jochen@scram.de>
*
- * $Id: packet-zebra.c,v 1.13 2001/06/18 02:17:58 guy Exp $
+ * $Id: packet-zebra.c,v 1.14 2001/07/16 06:09:02 guy Exp $
*
* Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@zing.org>
+ * By Gerald Combs <gerald@ethereal.com>
* Copyright 1998 Gerald Combs
- *
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -23,8 +22,6 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- *
*/
#ifdef HAVE_CONFIG_H
@@ -214,9 +211,8 @@ dissect_zebra_request(proto_tree *tree, gboolean request, tvbuff_t *tvb,
if (request) break;
/* Request just subscribes to messages */
- proto_tree_add_string(tree, hf_zebra_interface,
- tvb, offset, INTERFACE_NAMSIZ,
- tvb_get_ptr(tvb, offset, INTERFACE_NAMSIZ));
+ proto_tree_add_item(tree, hf_zebra_interface,
+ tvb, offset, INTERFACE_NAMSIZ, FALSE);
offset += INTERFACE_NAMSIZ;
proto_tree_add_item(tree, hf_zebra_index, tvb,
@@ -241,9 +237,8 @@ dissect_zebra_request(proto_tree *tree, gboolean request, tvbuff_t *tvb,
break;
case ZEBRA_INTERFACE_DELETE:
- proto_tree_add_string(tree, hf_zebra_interface,
- tvb, offset, INTERFACE_NAMSIZ,
- tvb_get_ptr(tvb, offset, INTERFACE_NAMSIZ));
+ proto_tree_add_item(tree, hf_zebra_interface,
+ tvb, offset, INTERFACE_NAMSIZ, FALSE);
offset += INTERFACE_NAMSIZ;
proto_tree_add_item(tree, hf_zebra_index, tvb,