aboutsummaryrefslogtreecommitdiffstats
path: root/packet-ncp2222.inc
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2002-10-11 21:52:11 +0000
committerGuy Harris <guy@alum.mit.edu>2002-10-11 21:52:11 +0000
commite4b32038a774328895afdf517bb7202c8ef34462 (patch)
tree24dd7ae83122fbd61d373f6b7722b6dd78eeee06 /packet-ncp2222.inc
parentb348f66dd4ffd1d32fa2ba1c701eb89cccf0873c (diff)
Make the flag buffer in "dissect_ping_req()" large enough to hold the
longest possible flag string. Don't create a temporary protocol tree unless we're not filling in a protocol tree. The NDS version isn't present in NDS pings prior to version 10; dissect it only if it's present. svn path=/trunk/; revision=6412
Diffstat (limited to 'packet-ncp2222.inc')
-rw-r--r--packet-ncp2222.inc15
1 files changed, 7 insertions, 8 deletions
diff --git a/packet-ncp2222.inc b/packet-ncp2222.inc
index 1d26ad8542..c9239d2473 100644
--- a/packet-ncp2222.inc
+++ b/packet-ncp2222.inc
@@ -8,7 +8,7 @@
* Gilbert Ramirez <gram@alumni.rice.edu>
* Modified to decode NDS packets by Greg Morris <gmorris@novell.com>
*
- * $Id: packet-ncp2222.inc,v 1.32 2002/10/11 19:36:12 guy Exp $
+ * $Id: packet-ncp2222.inc,v 1.33 2002/10/11 21:52:11 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -8205,7 +8205,7 @@ dissect_ping_req(tvbuff_t *tvb, packet_info *pinfo,
ptvcursor_t *ptvc = NULL;
proto_tree *temp_tree = NULL;
gint length_remaining = 0;
- char flags_str[1+3+1+3+1+3+1+3+1+1];
+ char flags_str[256];
char * sep = NULL;
proto_tree *flags_tree;
guint32 nds_flags;
@@ -8263,8 +8263,7 @@ dissect_ping_req(tvbuff_t *tvb, packet_info *pinfo,
* display filters can't possibly work. If we already have
* a proto_tree, then wonderful. If we don't, we need to build
* one. */
- if (ncp_rec)
- {
+ if (ncp_rec && ncp_tree != NULL) {
proto_item *ti;
temp_tree = proto_tree_create_root();
@@ -8305,12 +8304,12 @@ dissect_ping_req(tvbuff_t *tvb, packet_info *pinfo,
subfunc, "SubFunction: %d (0x%02x)",
subfunc, subfunc);
- proto_tree_add_item(ncp_tree, hf_nds_version, tvb, 8, 4,
- FALSE);
-
length_remaining = tvb_length_remaining(tvb, 8);
- if (length_remaining > 6)
+ if (length_remaining > 8)
{
+ proto_tree_add_item(ncp_tree, hf_nds_version, tvb, 8, 4,
+ FALSE);
+
nds_flags = tvb_get_letohl(tvb, 12);
strcpy(flags_str, " ");
sep = "(";