aboutsummaryrefslogtreecommitdiffstats
path: root/packet-mmse.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2002-01-08 20:51:16 +0000
committerGuy Harris <guy@alum.mit.edu>2002-01-08 20:51:16 +0000
commite1cee75f02e3f54cf0b0e76079a1204fcec2d064 (patch)
tree11a0b5a2e558a3bd2f3b3efe02b1d112e03209b0 /packet-mmse.c
parentc78cb46c0ee1862bd9d80b777a0a49b28d3fef25 (diff)
downloadwireshark-e1cee75f02e3f54cf0b0e76079a1204fcec2d064.tar.gz
wireshark-e1cee75f02e3f54cf0b0e76079a1204fcec2d064.tar.bz2
wireshark-e1cee75f02e3f54cf0b0e76079a1204fcec2d064.zip
From Tom Uijldert: fix to supply a non-null string argument to
"proto_tree_add_string_format()", so the item has a value, and so that Ethereal doesn't just crash. Get rid of some uses of "tvb_length()" - use "tvb_reported_length()", or -1, instead (so that we don't quit when we run out of captured data). Use "g_warning()", as other dissectors do, for reporting problems with packets. (They should really put it into the protocol tree, instead, but that's another matter....) svn path=/trunk/; revision=4500
Diffstat (limited to 'packet-mmse.c')
-rw-r--r--packet-mmse.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/packet-mmse.c b/packet-mmse.c
index 429e1f8c61..7f7e5cc3d3 100644
--- a/packet-mmse.c
+++ b/packet-mmse.c
@@ -2,7 +2,7 @@
* Routines for MMS Message Encapsulation dissection
* Copyright 2001, Tom Uijldert <tom.uijldert@cmg.nl>
*
- * $Id: packet-mmse.c,v 1.4 2001/12/10 00:25:30 guy Exp $
+ * $Id: packet-mmse.c,v 1.5 2002/01/08 20:51:16 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -386,7 +386,7 @@ dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/*
* Cycle through MMS-headers
*/
- while ((offset < tvb_length(tvb)) &&
+ while ((offset < tvb_reported_length(tvb)) &&
(field = tvb_get_guint8(tvb, offset++)) != MM_CTYPE_HDR)
{
switch (field)
@@ -600,7 +600,7 @@ dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
default:
if (field & 0x80) {
- fprintf(stderr,
+ g_warning(
"MMSE - Unknown field encountered (0x%02x)\n",
field);
} else {
@@ -614,8 +614,9 @@ dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_string_format(mmse_tree,
hf_mmse_ffheader,
tvb, offset,
- length + length2, NULL,
- "%s : %s",strval,strval2);
+ length + length2,
+ tvb_get_ptr(tvb,offset,length + length2),
+ "%s: %s",strval,strval2);
offset += length + length2;
}
break;
@@ -632,9 +633,7 @@ dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
const char *type_str;
offset = add_content_type(mmse_tree, tvb, offset, &type, &type_str);
- tmp_tvb = tvb_new_subset(tvb, offset,
- tvb_length_remaining(tvb, offset),
- tvb_length_remaining(tvb, offset));
+ tmp_tvb = tvb_new_subset(tvb, offset, -1, -1);
add_multipart_data(mmse_tree, tmp_tvb);
}
}