From 3ea788d1a786e64576136e8707bc2392dde5d325 Mon Sep 17 00:00:00 2001 From: hippoz <10706925-hippoz@users.noreply.gitlab.com> Date: Mon, 26 Dec 2022 20:31:12 +0200 Subject: [PATCH] check for little endian --- wire.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wire.c b/wire.c index f8ac6c4..1b533bf 100644 --- a/wire.c +++ b/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 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->flags = *(uint8_t*)TRYPTR(wire_get_u8(c)); msg->protocol_version = *(uint8_t*)TRYPTR(wire_get_u8(c));