diff options
author | Adrian Szyndela <adrian.s@samsung.com> | 2018-06-05 09:33:47 +0200 |
---|---|---|
committer | Adrian Szyndela <adrian.s@samsung.com> | 2018-06-05 09:37:38 +0200 |
commit | 6b199fd8a3a01bf0246411dfc43955ee2108c61c (patch) | |
tree | 76e8aec447bb75c319ae0e7ef68c15ff7c538757 | |
parent | 9df0e8caebfc7739155d415d6823362cb9d801bf (diff) | |
download | dbus-6b199fd8a3a01bf0246411dfc43955ee2108c61c.tar.gz dbus-6b199fd8a3a01bf0246411dfc43955ee2108c61c.tar.bz2 dbus-6b199fd8a3a01bf0246411dfc43955ee2108c61c.zip |
dbus: a couple of corrections after static analysis
dbus-transport-kdbus.c:900
SVACE 19383: Assignment of a signed value which has type 'int'
to a variable of a bigger integer type 'dbus_uint64_t'
dbus-transport-kdbus.c:2464
SVACE 2044: Checking return value of dbus_message_get_interface().
Change-Id: Ic793c2d414aa77273b9ff3eff83a72b4f3e4d815
-rwxr-xr-x | dbus/dbus-transport-kdbus.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/dbus/dbus-transport-kdbus.c b/dbus/dbus-transport-kdbus.c index 0683db5d..e8b333ad 100755 --- a/dbus/dbus-transport-kdbus.c +++ b/dbus/dbus-transport-kdbus.c @@ -890,14 +890,16 @@ kdbus_write_msg_internal (DBusTransportKdbus *transport, { while (body_size > 0) { - dbus_uint64_t part_size = body_size; + dbus_uint32_t part_size; - if (part_size > KDBUS_MSG_MAX_PAYLOAD_VEC_SIZE) - part_size = KDBUS_MSG_MAX_PAYLOAD_VEC_SIZE; + if (body_size < KDBUS_MSG_MAX_PAYLOAD_VEC_SIZE) + part_size = body_size; + else + part_size = KDBUS_MSG_MAX_PAYLOAD_VEC_SIZE; /* we need to adjust part size if footer does not fit as a whole */ if (body_size - part_size > 0 && footer_ptr < (body_data + part_size)) - part_size = (dbus_uint64_t)(footer_ptr - body_data); + part_size = footer_ptr - body_data; _dbus_verbose ("attaching body part\n"); item = _kdbus_item_add_payload_vec (item, @@ -2461,7 +2463,8 @@ capture_org_freedesktop_DBus (DBusTransportKdbus *transport, int ret = 1; if (!strcmp (destination, DBUS_SERVICE_DBUS)) { - if (!strcmp (dbus_message_get_interface (message), DBUS_INTERFACE_DBUS)) + const char *interface = dbus_message_get_interface (message); + if (interface && !strcmp (interface, DBUS_INTERFACE_DBUS)) { DBusError error; const char *member = dbus_message_get_member (message); |