aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-wsp.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2005-04-16 22:25:54 +0000
committerGerald Combs <gerald@wireshark.org>2005-04-16 22:25:54 +0000
commitd19929cd62c7340f98a6fa6c7649aff5650c51eb (patch)
tree0cf98ef9f4583f1ae70081ebad5957e95381fcc8 /epan/dissectors/packet-wsp.c
parentfdb2184315bd159c4242a329410f4bf737af92d5 (diff)
Add a few tvb_ensure_bytes_exist() calls. Fixes bug 35.
svn path=/trunk/; revision=14109
Diffstat (limited to 'epan/dissectors/packet-wsp.c')
-rw-r--r--epan/dissectors/packet-wsp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/epan/dissectors/packet-wsp.c b/epan/dissectors/packet-wsp.c
index 3437112aef..96a67fabad 100644
--- a/epan/dissectors/packet-wsp.c
+++ b/epan/dissectors/packet-wsp.c
@@ -2197,12 +2197,14 @@ wkh_ ## underscored (proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_
proto_tree *parameter_tree = NULL; \
\
wkh_1_WellKnownValue; \
+ tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
tvb, hdr_start, offset - hdr_start, \
val_to_str(val_id & 0x7F, valueString, \
"<Unknown " valueName " identifier 0x%X>")); \
ok = TRUE; \
wkh_2_TextualValue; \
+ tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
tvb, hdr_start, offset - hdr_start, val_str); \
ok = TRUE; \
@@ -2213,11 +2215,13 @@ wkh_ ## underscored (proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_
get_token_text(val_str, tvb, off, len, ok); \
/* As we're using val_str, it is automatically g_free()d */ \
off += len; /* off now points to 1st byte after string */ \
+ tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
ti = proto_tree_add_string (tree, hf_hdr_ ## underscored, \
tvb, hdr_start, offset - hdr_start, val_str); \
} else if (is_integer_value(peek)) { \
get_integer_value(val, tvb, off, len, ok); \
if (ok) { \
+ tvb_ensure_bytes_exist(tvb, hdr_start, offset - hdr_start); \
ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
tvb, hdr_start, offset - hdr_start, \
val_to_str(val, valueString, \