File dbus-1.4.1-byteorder.patch of Package dbus-1.937

Index: dbus-1.4.1/dbus/dbus-marshal-header.c
===================================================================
--- dbus-1.4.1.orig/dbus/dbus-marshal-header.c
+++ dbus-1.4.1/dbus/dbus-marshal-header.c
@@ -1468,14 +1468,20 @@ void
 _dbus_header_byteswap (DBusHeader *header,
                        int         new_order)
 {
+  unsigned char byte_order;
+
   if (header->byte_order == new_order)
     return;
 
+  byte_order = _dbus_string_get_byte (&header->data, BYTE_ORDER_OFFSET);
+  _dbus_assert (header->byte_order == byte_order);
+
   _dbus_marshal_byteswap (&_dbus_header_signature_str,
                           0, header->byte_order,
                           new_order,
                           &header->data, 0);
 
+  _dbus_string_set_byte (&header->data, BYTE_ORDER_OFFSET, new_order);
   header->byte_order = new_order;
 }
openSUSE Build Service is sponsored by