diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2003-05-15 05:18:17 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2003-05-15 05:18:17 +0000 |
commit | a8c6001f09fda007516da8008b4c0f419750a573 (patch) | |
tree | cab19bddcb6df1ddee352f3d61e920d3675fb75e /packet-tacacs.c | |
parent | 9a41620261a6457c18bb359cf09afe2dab823dc4 (diff) |
"tvb_get_nstringz0()" now expects, as an argument, a value 1 greater
than the number of bytes to copy, as the value includes the terminating
'\0' added on.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7671 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-tacacs.c')
-rw-r--r-- | packet-tacacs.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/packet-tacacs.c b/packet-tacacs.c index 64c3ff2292..ef11de87b2 100644 --- a/packet-tacacs.c +++ b/packet-tacacs.c @@ -2,7 +2,7 @@ * Routines for cisco tacacs/xtacacs/tacacs+ packet dissection * Copyright 2001, Paul Ionescu <paul@acorp.ro> * - * $Id: packet-tacacs.c,v 1.23 2002/08/28 21:00:35 jmayer Exp $ + * $Id: packet-tacacs.c,v 1.24 2003/05/15 05:18:17 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -122,7 +122,7 @@ dissect_tacacs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_tree *tacacs_tree; proto_item *ti; - guint8 txt_buff[256],version,type,userlen,passlen; + guint8 txt_buff[255+1],version,type,userlen,passlen; if (check_col(pinfo->cinfo, COL_PROTOCOL)) col_set_str(pinfo->cinfo, COL_PROTOCOL, "TACACS"); @@ -163,9 +163,9 @@ dissect_tacacs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) passlen=tvb_get_guint8(tvb,5); proto_tree_add_uint(tacacs_tree, hf_tacacs_passlen, tvb, 5, 1, passlen); - tvb_get_nstringz0(tvb,6,userlen,txt_buff); + tvb_get_nstringz0(tvb,6,userlen+1,txt_buff); proto_tree_add_text(tacacs_tree, tvb, 6, userlen, "Username: %s",txt_buff); - tvb_get_nstringz0(tvb,6+userlen,passlen,txt_buff); + tvb_get_nstringz0(tvb,6+userlen,passlen+1,txt_buff); proto_tree_add_text(tacacs_tree, tvb, 6+userlen, passlen, "Password: %s",txt_buff); } else @@ -202,9 +202,9 @@ dissect_tacacs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) FALSE); if (type!=TACACS_RESPONSE) { - tvb_get_nstringz0(tvb,26,userlen,txt_buff); + tvb_get_nstringz0(tvb,26,userlen+1,txt_buff); proto_tree_add_text(tacacs_tree, tvb, 26, userlen, "Username: %s",txt_buff); - tvb_get_nstringz0(tvb,26+userlen,passlen,txt_buff); + tvb_get_nstringz0(tvb,26+userlen,passlen+1,txt_buff); proto_tree_add_text(tacacs_tree, tvb, 26+userlen, passlen, "Password; %s",txt_buff); } } |