Commit 64d6dbd1 authored by Simon McVittie's avatar Simon McVittie Committed by Simon McVittie

Statically assert that the DBusMessageIter struct has no padding

Signed-off-by: default avatarSimon McVittie <>
Reviewed-by: Thiago Macieira's avatarThiago Macieira <>
parent 38a5c302
......@@ -2058,6 +2058,11 @@ _dbus_message_iter_init_common (DBusMessage *message,
sizeof (DBusMessageIter));
_DBUS_STATIC_ASSERT (_DBUS_ALIGNOF (DBusMessageIter_1_10_0) ==
_DBUS_ALIGNOF (DBusMessageIter));
/* If this static assertion fails, it means the DBusMessageIter struct
* is not "packed", which might result in "iter = other_iter" not copying
* every byte. */
_DBUS_STATIC_ASSERT (sizeof (DBusMessageIter) ==
4 * sizeof (void *) + sizeof (dbus_uint32_t) + 9 * sizeof (int));
/* Since the iterator will read or write who-knows-what from the
* message, we need to get in the right byte order
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment