mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-01 04:28:01 +02:00
2005-06-16 Colin Walters <walters@verbum.org>
* dbus/dbus-marshal-header.c (_dbus_header_load): Set header byte order from expected byte order (Patch from Chris Wilson, #3475). * dbus/dbus-marshal-byteswap.c (byteswap_body_helper): Increment pointer after swapping fixed array. Add assertion for array length.
This commit is contained in:
parent
5cd4c9ac5f
commit
5935f33b75
3 changed files with 15 additions and 2 deletions
|
|
@ -1,3 +1,12 @@
|
|||
2005-06-16 Colin Walters <walters@verbum.org>
|
||||
|
||||
* dbus/dbus-marshal-header.c (_dbus_header_load): Set
|
||||
header byte order from expected byte order (Patch from Chris Wilson, #3475).
|
||||
|
||||
* dbus/dbus-marshal-byteswap.c (byteswap_body_helper):
|
||||
Increment pointer after swapping fixed array. Add assertion
|
||||
for array length.
|
||||
|
||||
2005-06-15 Colin Walters <walters@verbum.org>
|
||||
|
||||
* dbus/dbus-sysdeps.c <HAVE_CMSGCRED> (_dbus_read_credentials_unix_socket):
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ byteswap_body_helper (DBusTypeReader *reader,
|
|||
p = _DBUS_ALIGN_ADDRESS (p, 4);
|
||||
|
||||
array_len = _dbus_unpack_uint32 (old_byte_order, p);
|
||||
|
||||
|
||||
*((dbus_uint32_t*)p) = DBUS_UINT32_SWAP_LE_BE (*((dbus_uint32_t*)p));
|
||||
p += 4;
|
||||
|
||||
|
|
@ -102,12 +102,15 @@ byteswap_body_helper (DBusTypeReader *reader,
|
|||
elem_type = _dbus_type_reader_get_element_type (reader);
|
||||
alignment = _dbus_type_get_alignment (elem_type);
|
||||
|
||||
_dbus_assert ((array_len / alignment) < DBUS_MAXIMUM_ARRAY_LENGTH);
|
||||
|
||||
p = _DBUS_ALIGN_ADDRESS (p, alignment);
|
||||
|
||||
if (dbus_type_is_fixed (elem_type))
|
||||
{
|
||||
if (alignment > 1)
|
||||
_dbus_swap_array (p, array_len / alignment, alignment);
|
||||
_dbus_swap_array (p, array_len / alignment, alignment);
|
||||
p += array_len;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1040,6 +1040,7 @@ _dbus_header_load (DBusHeader *header,
|
|||
_dbus_type_reader_next (&reader);
|
||||
|
||||
_dbus_assert (v_byte == byte_order);
|
||||
header->byte_order = byte_order;
|
||||
|
||||
/* MESSAGE TYPE */
|
||||
_dbus_assert (_dbus_type_reader_get_current_type (&reader) == DBUS_TYPE_BYTE);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue