diff options
author | Guy Harris <guy@alum.mit.edu> | 2003-12-27 04:01:17 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2003-12-27 04:01:17 +0000 |
commit | 821fd8405bf9bad30fde79586df8119d5fd94124 (patch) | |
tree | 7e61fa15d33129a497b7baa5048f975bf575bf9d /packet-ndmp.c | |
parent | 46ce3ac2fae85ea0d809ce10ba029fa82a4ae1fe (diff) |
Don't create a protocol tree entry for the body of an NDMP request or
reply if there isn't a body, just a header, so that we don't throw an
exception and mark the frame as malformed if the request or reply isn't
supposed to have a body.
svn path=/trunk/; revision=9454
Diffstat (limited to 'packet-ndmp.c')
-rw-r--r-- | packet-ndmp.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/packet-ndmp.c b/packet-ndmp.c index 9bf8bd38ce..f0ee37b8fa 100644 --- a/packet-ndmp.c +++ b/packet-ndmp.c @@ -2,7 +2,7 @@ * Routines for NDMP dissection * 2001 Ronnie Sahlberg (see AUTHORS for email) * - * $Id: packet-ndmp.c,v 1.24 2003/04/21 08:13:18 guy Exp $ + * $Id: packet-ndmp.c,v 1.25 2003/12/27 04:01:17 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -2628,10 +2628,12 @@ dissect_ndmp_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree return offset; } - if(tree){ - cmd_item = proto_tree_add_text(tree, tvb, offset, -1, - msg_vals[i].strptr); - cmd_tree = proto_item_add_subtree(cmd_item, ett_ndmp); + if (tvb_reported_length_remaining(tvb, offset) > 0) { + if(tree){ + cmd_item = proto_tree_add_text(tree, tvb, offset, -1, + msg_vals[i].strptr); + cmd_tree = proto_item_add_subtree(cmd_item, ett_ndmp); + } } if(nh->type==NDMP_MESSAGE_REQUEST){ |