aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Biot <obiot.ethereal@gmail.com>2005-03-22 22:27:14 +0000
committerOlivier Biot <obiot.ethereal@gmail.com>2005-03-22 22:27:14 +0000
commit71d79f31c0095fae4533656e6d43506bc2e29171 (patch)
tree716777660c9255cc04344bc4966a37dbbc37850c
parentb955abc3edb75513c2e82a08dbcc9a9396d14c70 (diff)
As suggested by Ulf Lamping, prevent Ethereal from bailing out if there's a protocol error, as we now have a DISSECTOR_ASSERT() macro.
svn path=/trunk/; revision=13869
-rw-r--r--epan/dissectors/packet-wsp.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/epan/dissectors/packet-wsp.c b/epan/dissectors/packet-wsp.c
index f6bc6cedce..3489415303 100644
--- a/epan/dissectors/packet-wsp.c
+++ b/epan/dissectors/packet-wsp.c
@@ -1281,7 +1281,7 @@ static void add_headers (proto_tree *tree, tvbuff_t *tvb, int hf, packet_info *p
#define get_text_string(str,tvb,start,len,ok) \
if (is_text_string(tvb_get_guint8(tvb,start))) { \
str = (gchar *)tvb_get_stringz(tvb,start,(gint *)&len); \
- g_assert (str); \
+ DISSECTOR_ASSERT (str); \
ok = TRUE; \
} else { len = 0; str = NULL; ok = FALSE; }
#define get_token_text(str,tvb,start,len,ok) \
@@ -1794,7 +1794,7 @@ add_headers (proto_tree *tree, tvbuff_t *tvb, int hf, packet_info *pinfo)
/* Call header value dissector for given header */
if (val_id >= 0x20 && val_id <=0x7E) { /* OK! */
val_str = (gchar *)tvb_get_stringz(tvb, val_start, (gint *)&val_len);
- g_assert(val_str);
+ DISSECTOR_ASSERT (val_str);
offset = val_start + val_len;
proto_tree_add_text(wsp_headers,tvb,hdr_start,offset-hdr_start,
"%s: %s", hdr_str, val_str);
@@ -1814,7 +1814,7 @@ add_headers (proto_tree *tree, tvbuff_t *tvb, int hf, packet_info *pinfo)
tv.secs = val;
tv.nsecs = 0;
val_str = abs_time_to_str(&tv);
- g_assert (val_str);
+ DISSECTOR_ASSERT (val_str);
ti = proto_tree_add_string (wsp_headers,
hf_hdr_x_wap_tod,
tvb, hdr_start, hdr_len + val_len, val_str);
@@ -1915,7 +1915,7 @@ add_headers (proto_tree *tree, tvbuff_t *tvb, int hf, packet_info *pinfo)
/* END */ \
} else if ((val_id == 0) || (val_id >= 0x20)) { /* Textual value */ \
val_str = (gchar *)tvb_get_stringz (tvb, val_start, (gint *)&val_len); \
- g_assert(val_str); \
+ DISSECTOR_ASSERT (val_str); \
offset = val_start + val_len; \
/* Textual value processing starts HERE \
* \
@@ -2789,7 +2789,7 @@ wkh_ ## underscored(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_i
tv.secs = val; \
tv.nsecs = 0; \
str = abs_time_to_str(&tv); \
- g_assert(str); \
+ DISSECTOR_ASSERT (str); \
ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
tvb, hdr_start, offset - hdr_start, str); \
/* BEHOLD: do NOT try to free str, as this generates a core
@@ -2828,7 +2828,7 @@ wkh_ ## underscored(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_i
tv.secs = val; \
tv.nsecs = 0; \
str = abs_time_to_str(&tv); \
- g_assert(str); \
+ DISSECTOR_ASSERT (str); \
ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
tvb, hdr_start, offset - hdr_start, str); \
/* BEHOLD: do NOT try to free str, as this generates a core
@@ -2883,7 +2883,7 @@ wkh_ ## underscored(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_i
tv.secs = val; \
tv.nsecs = 0; \
str = abs_time_to_str(&tv); \
- g_assert(str); \
+ DISSECTOR_ASSERT (str); \
ti = proto_tree_add_string(tree, hf_hdr_ ## underscored, \
tvb, hdr_start, offset - hdr_start, str); \
} \
@@ -3528,7 +3528,7 @@ wkh_profile_warning(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_i
tv.secs = val;
tv.nsecs = 0;
val_str = abs_time_to_str(&tv);
- g_assert(val_str);
+ DISSECTOR_ASSERT (val_str);
str = g_strdup_printf("; date=%s", val_str);
proto_item_append_string(ti, str);
g_free(str); /* proto_XXX creates a copy */