aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss.ws@gmail.com>2012-12-16 19:26:12 +0000
committerJeff Morriss <jeff.morriss.ws@gmail.com>2012-12-16 19:26:12 +0000
commitbd3a06065df7331dcf7e734ae247d71448dc7f8e (patch)
tree3faa6247afc46a265ad8332978ddcec674996994 /epan
parentdcd8c7151fed925c91fb062daa108ce724eaa987 (diff)
Another composite-TVB fix inspired by
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8097 : Assert out if tvb_composite_finalize() is called on a composite TVB with no members (sub-TVBs). svn path=/trunk/; revision=46570
Diffstat (limited to 'epan')
-rw-r--r--epan/tvbuff.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/epan/tvbuff.c b/epan/tvbuff.c
index d7dccb755a..5246159055 100644
--- a/epan/tvbuff.c
+++ b/epan/tvbuff.c
@@ -645,6 +645,12 @@ tvb_composite_finalize(tvbuff_t *tvb)
composite = &tvb->tvbuffs.composite;
num_members = g_slist_length(composite->tvbs);
+ /* Dissectors should not create composite TVBs if they're not going to
+ * put at least one TVB in them.
+ * (Without this check--or something similar--we'll seg-fault below.)
+ */
+ DISSECTOR_ASSERT(num_members);
+
composite->start_offsets = g_new(guint, num_members);
composite->end_offsets = g_new(guint, num_members);