From bce09f31d916d9ba935590c0db9e87483dfd6d8a Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 19 Sep 2011 17:06:00 +0100 Subject: [PATCH 2/9] _dbus_message_iter_check: only assert about the writer if sig_refcount > 0 --- dbus/dbus-message.c | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-) diff --git a/dbus/dbus-message.c b/dbus/dbus-message.c index cc1cfa1..5d7f62c 100644 --- a/dbus/dbus-message.c +++ b/dbus/dbus-message.c @@ -690,13 +690,16 @@ _dbus_message_iter_check (DBusMessageRealIter *iter) } else if (iter->iter_type == DBUS_MESSAGE_ITER_TYPE_WRITER) { - if (iter->u.writer.byte_order != byte_order) + if (iter->sig_refcount > 0) { - _dbus_warn_check_failed ("dbus message changed byte order since append iterator was created\n"); - return FALSE; + if (iter->u.writer.byte_order != byte_order) + { + _dbus_warn_check_failed ("dbus message changed byte order since append iterator was created\n"); + return FALSE; + } + /* because we swap the message into compiler order when you init an iter */ + _dbus_assert (iter->u.writer.byte_order == DBUS_COMPILER_BYTE_ORDER); } - /* because we swap the message into compiler order when you init an iter */ - _dbus_assert (iter->u.writer.byte_order == DBUS_COMPILER_BYTE_ORDER); } else { -- 1.7.6.3