diff --git a/glib/gvariant-serialiser.c b/glib/gvariant-serialiser.c index d5970d2d1..6ebaec7d4 100644 --- a/glib/gvariant-serialiser.c +++ b/glib/gvariant-serialiser.c @@ -983,6 +983,10 @@ gvs_tuple_needed_size (GVariantTypeInfo *type_info, offset = 0; + /* We must go through at least one iteration below. If the tuple had no + * children, it would have a fixed size. */ + g_assert (n_children > 0); + for (i = 0; i < n_children; i++) { guint alignment;