From 66f3ccd43629aa7ce4fb44bc7474603ef108aa52 Mon Sep 17 00:00:00 2001 From: "sanghyeok.oh" Date: Mon, 1 Jul 2019 17:42:36 +0900 Subject: gvariant: fix UBSan related code fix Undefined Behavior Sanitizer error. Change-Id: If3b68e68d4de753d0e66c0eeb07f626431057cbf Signed-off-by: sanghyeok.oh --- dbus/dbus-marshal-gvariant.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dbus/dbus-marshal-gvariant.c b/dbus/dbus-marshal-gvariant.c index d9af97a1..85e53cdf 100644 --- a/dbus/dbus-marshal-gvariant.c +++ b/dbus/dbus-marshal-gvariant.c @@ -47,7 +47,7 @@ _dbus_get_gvariant_header_signature_str (void) static dbus_bool_t append_sized_value (DBusString *str, - size_t value, + dbus_uint64_t value, size_t value_size) { /* always write as little endian */ @@ -55,7 +55,7 @@ append_sized_value (DBusString *str, for (i = 0; i < value_size; i++) { size_t move = 8 * i; - size_t mask = 0xFF << move; + dbus_uint64_t mask = 0xFFull << move; if (!_dbus_string_append_byte(str, (value & mask) >> move)) return FALSE; } -- cgit v1.2.3