diff options
author | Guy Harris <guy@alum.mit.edu> | 2004-07-02 08:27:24 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2004-07-02 08:27:24 +0000 |
commit | f9c56ec52502e759cda860785af759db144bac4f (patch) | |
tree | f36f29991e1ff2b77598a559b9b11b2febe61fec | |
parent | 227ba2f04b2db858d1de845dd74b880b438e5969 (diff) | |
download | wireshark-f9c56ec52502e759cda860785af759db144bac4f.tar.gz |
From Martin van der Werff: don't do "tvb_ensure_length_remaining()" to
create the parameter tvbuff, as that requires that there's at least one
byte of parameter data, and some messages have no parameters and would
cause an exception to be thrown in that case.
Just use -1 for the length parameters when creating the parameter
tvbuff, so that it includes the full reported length.
Don't put undissected parameter information into the protocol tree if
there aren't any parameters - and don't bother getting the number of
bytes of parameter information unless we're putting undissected
parameter information into the protocol tree and need it to see whether
there are any parameters.
svn path=/trunk/; revision=11297
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | packet-isup.c | 17 |
2 files changed, 12 insertions, 6 deletions
@@ -2220,6 +2220,7 @@ Philippe Mazeau <philippe.mazeau [AT] swissvoice.net> Carles Kishimoto <ckishimo [AT] ac.upc.es> Dennis Lim <Dennis.Lim [AT] motorola.com> <postadal [AT] suse.cz> +Martin van der Werff <martin [AT] vanderwerff.org> Alain Magloire <alainm[AT]rcsm.ece.mcgill.ca> was kind enough to give his permission to use his version of snprintf.c. diff --git a/packet-isup.c b/packet-isup.c index b95893bd59..02a9b5bfbb 100644 --- a/packet-isup.c +++ b/packet-isup.c @@ -9,7 +9,7 @@ * Modified 2004-01-10 by Anders Broman to add abillity to dissect * Content type application/ISUP RFC 3204 used in SIP-T * - * $Id: packet-isup.c,v 1.61 2004/04/03 22:13:38 etxrab Exp $ + * $Id: packet-isup.c,v 1.62 2004/07/02 08:27:24 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -5215,8 +5215,7 @@ dissect_isup_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *isup tap_queue_packet(isup_tap, pinfo, &tap_rec); - bufferlength = tvb_ensure_length_remaining(message_tvb, offset); - parameter_tvb = tvb_new_subset(message_tvb, offset, bufferlength, bufferlength); + parameter_tvb = tvb_new_subset(message_tvb, offset, -1, -1); /* distinguish between message types:*/ switch (message_type) { @@ -5357,7 +5356,9 @@ dissect_isup_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *isup break; case MESSAGE_TYPE_CHARGE_INFO: /* do nothing since format is a national matter */ - proto_tree_add_text(isup_tree, parameter_tvb, 0, bufferlength, "Format is a national matter"); + bufferlength = tvb_length_remaining(message_tvb, offset); + if (bufferlength != 0) + proto_tree_add_text(isup_tree, parameter_tvb, 0, bufferlength, "Format is a national matter"); break; case MESSAGE_TYPE_NETW_RESRC_MGMT: /* no dissector necessary since no mandatory parameters included */ @@ -5401,11 +5402,15 @@ dissect_isup_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *isup break; case MESSAGE_TYPE_SUBSEQUENT_DIR_NUM: /* do nothing since format is a national matter */ - proto_tree_add_text(isup_tree, parameter_tvb, 0, bufferlength, "Format is a national matter"); + bufferlength = tvb_length_remaining(message_tvb, offset); + if (bufferlength != 0) + proto_tree_add_text(isup_tree, parameter_tvb, 0, bufferlength, "Format is a national matter"); break; default: - proto_tree_add_text(isup_tree, parameter_tvb, 0, bufferlength, "Unknown Message type (possibly reserved/used in former ISUP version)"); + bufferlength = tvb_length_remaining(message_tvb, offset); + if (bufferlength != 0) + proto_tree_add_text(isup_tree, parameter_tvb, 0, bufferlength, "Unknown Message type (possibly reserved/used in former ISUP version)"); break; } |