diff options
author | Guy Harris <guy@alum.mit.edu> | 2002-05-01 08:34:04 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2002-05-01 08:34:04 +0000 |
commit | 8a9219d10f2ce7cd36f4e3a75c19f51072dfee62 (patch) | |
tree | 1a3c18416452059a7671f8fe45df5e2ec9691837 | |
parent | f10633662457bbce69abaf3439e4e7890eaddcef (diff) |
From Joerg Mayer: get rid of an unused argument.
Make the loop to dissect NBSS packets run to the end of the reported
data, so it throws an exception on a short frame.
Use -1 rather than "tvb_length(tvb)" for the length of items that run to
the end of the frame.
svn path=/trunk/; revision=5336
-rw-r--r-- | packet-nbns.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/packet-nbns.c b/packet-nbns.c index eae3224087..df33a25d60 100644 --- a/packet-nbns.c +++ b/packet-nbns.c @@ -3,7 +3,7 @@ * to when it had only NBNS) * Guy Harris <guy@alum.mit.edu> * - * $Id: packet-nbns.c,v 1.74 2002/02/28 23:09:03 guy Exp $ + * $Id: packet-nbns.c,v 1.75 2002/05/01 08:34:04 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -1350,7 +1350,7 @@ static const value_string error_codes[] = { */ static int dissect_nbss_packet(tvbuff_t *tvb, int offset, packet_info *pinfo, - proto_tree *tree, int max_data, int is_cifs) + proto_tree *tree, int is_cifs) { proto_tree *nbss_tree = NULL; proto_item *ti = NULL; @@ -1704,9 +1704,8 @@ dissect_nbss(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) val_to_str(msg_type, message_types, "Unknown (%02x)")); } - while (max_data > 0) { - len = dissect_nbss_packet(tvb, offset, pinfo, tree, max_data, - is_cifs); + while (tvb_reported_length_remaining(tvb, offset) > 0) { + len = dissect_nbss_packet(tvb, offset, pinfo, tree, is_cifs); if (len < 0) { /* * We need more data to dissect this, and @@ -1722,7 +1721,6 @@ dissect_nbss(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) return; } offset += len; - max_data -= len; } return; @@ -1735,11 +1733,9 @@ continuation: col_add_fstr(pinfo->cinfo, COL_INFO, "NBSS Continuation Message"); if (tree) { - ti = proto_tree_add_item(tree, proto_nbss, tvb, 0, - max_data, FALSE); + ti = proto_tree_add_item(tree, proto_nbss, tvb, 0, -1, FALSE); nbss_tree = proto_item_add_subtree(ti, ett_nbss); - proto_tree_add_text(nbss_tree, tvb, 0, max_data, - "Continuation data"); + proto_tree_add_text(nbss_tree, tvb, 0, -1, "Continuation data"); } } |