check for little endian
This commit is contained in:
parent
8a218a7ac2
commit
3ea788d1a7
1 changed files with 5 additions and 0 deletions
5
wire.c
5
wire.c
|
@ -128,6 +128,11 @@ int wire_parse_message(wire_context_t *c, wire_message_t *msg)
|
||||||
{
|
{
|
||||||
// SPEC: https://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-messages
|
// SPEC: https://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-messages
|
||||||
msg->endianness = *(uint8_t*)TRYPTR(wire_get_u8(c));
|
msg->endianness = *(uint8_t*)TRYPTR(wire_get_u8(c));
|
||||||
|
if (msg->endianness == 'B') {
|
||||||
|
// we only support little endian
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
msg->type = *(uint8_t*)TRYPTR(wire_get_u8(c));
|
msg->type = *(uint8_t*)TRYPTR(wire_get_u8(c));
|
||||||
msg->flags = *(uint8_t*)TRYPTR(wire_get_u8(c));
|
msg->flags = *(uint8_t*)TRYPTR(wire_get_u8(c));
|
||||||
msg->protocol_version = *(uint8_t*)TRYPTR(wire_get_u8(c));
|
msg->protocol_version = *(uint8_t*)TRYPTR(wire_get_u8(c));
|
||||||
|
|
Loading…
Reference in a new issue