From f86fe620e5b62b7026b9bbb6cd2ec5738107e02c Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 6 Jun 2011 14:51:35 +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 a59ed9b..d81e74f 100644 --- a/dbus/dbus-message.c +++ b/dbus/dbus-message.c @@ -679,13 +679,16 @@ _dbus_message_iter_check (DBusMessageRealIter *iter) } else if (iter->iter_type == DBUS_MESSAGE_ITER_TYPE_WRITER) { - if (iter->u.writer.byte_order != iter->message->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 != iter->message->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.5.4