aboutsummaryrefslogtreecommitdiffstats
path: root/packet-vrrp.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2003-06-12 06:58:38 +0000
committerGuy Harris <guy@alum.mit.edu>2003-06-12 06:58:38 +0000
commit7794698ef158516e82e672101df1c86754725ead (patch)
treea448a6640abac4ecebafe9745b5e03e9302efa14 /packet-vrrp.c
parent8644f8baea7e6ecb7396e583d653c5e056dafb1c (diff)
The authentication field in a VRRP packet is 8 bytes long, not 9 bytes
long, so the length of the protocol tree item for it should be 8 bytes; the buffer into which we copy it should still be 9 bytes long, to include a trailing null. svn path=/trunk/; revision=7854
Diffstat (limited to 'packet-vrrp.c')
-rw-r--r--packet-vrrp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/packet-vrrp.c b/packet-vrrp.c
index 912e74b98b..fbf485c488 100644
--- a/packet-vrrp.c
+++ b/packet-vrrp.c
@@ -4,7 +4,7 @@
*
* Heikki Vatiainen <hessu@cs.tut.fi>
*
- * $Id: packet-vrrp.c,v 1.26 2003/04/30 02:35:20 gerald Exp $
+ * $Id: packet-vrrp.c,v 1.27 2003/06/12 06:58:38 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -52,7 +52,7 @@ static gint hf_vrrp_ip6 = -1;
#define VRRP_VERSION_MASK 0xf0
#define VRRP_TYPE_MASK 0x0f
-#define VRRP_AUTH_DATA_LEN 9
+#define VRRP_AUTH_DATA_LEN 8
#define VRRP_TYPE_ADVERTISEMENT 1
static const value_string vrrp_type_vals[] = {
@@ -107,7 +107,7 @@ dissect_vrrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree *vrrp_tree, *ver_type_tree;
guint8 priority, ip_count = 0, auth_type;
guint16 cksum, computed_cksum;
- guint8 auth_buf[VRRP_AUTH_DATA_LEN];
+ guint8 auth_buf[VRRP_AUTH_DATA_LEN + 1];
ti = proto_tree_add_item(tree, proto_vrrp, tvb, 0, -1, FALSE);
vrrp_tree = proto_item_add_subtree(ti, ett_vrrp);
@@ -215,7 +215,7 @@ dissect_vrrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (auth_type != VRRP_AUTH_TYPE_SIMPLE_TEXT)
return; /* Contents of the authentication data is undefined */
- tvb_get_nstringz0(tvb, offset, VRRP_AUTH_DATA_LEN, auth_buf);
+ tvb_get_nstringz0(tvb, offset, sizeof auth_buf, auth_buf);
if (auth_buf[0] != '\0')
proto_tree_add_text(vrrp_tree, tvb, offset,
VRRP_AUTH_DATA_LEN,