diff options
author | Sangyoon Jang <s89.jang@samsung.com> | 2014-01-03 15:35:57 +0900 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2015-02-11 11:55:31 +0100 |
commit | 07126bda70f5d1f7ec3c64e29dacb9fe5518a714 (patch) | |
tree | cbf5c8d8b62791afb04d3e65701eae494e86e404 | |
parent | 9e9394ec5b1f3b361027ff64b768212e5bdfc025 (diff) |
[lib-fix] Fixed message handling
the message which has only header(body size is 0) doesn't cause io_error now
(such as KDBUS_ITEM_REPLY_DEAD has 0 size body)
Change-Id: I7f0cece23c6aa88761dba979f82e8e33622bf600
-rw-r--r-- | dbus/dbus-transport-kdbus.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/dbus/dbus-transport-kdbus.c b/dbus/dbus-transport-kdbus.c index d590a020..72e3d564 100644 --- a/dbus/dbus-transport-kdbus.c +++ b/dbus/dbus-transport-kdbus.c @@ -703,7 +703,7 @@ static int kdbus_message_size(const struct kdbus_msg* msg) KDBUS_PART_FOREACH(item, msg, items) { - if (item->size <= KDBUS_ITEM_HEADER_SIZE) + if (item->size < KDBUS_ITEM_HEADER_SIZE) { _dbus_verbose(" +%s (%llu bytes) invalid data record\n", enum_MSG(item->type), item->size); return -1; @@ -743,7 +743,7 @@ static int kdbus_decode_msg(const struct kdbus_msg* msg, char *data, DBusTranspo DBusMessage *message = NULL; DBusMessageIter args; const char* emptyString = ""; - const char* pString = NULL; + const char* pString = NULL; char dbus_name[(unsigned int)(snprintf((char*)pString, 0, ":1.%llu0", ULLONG_MAX))]; const char* pDBusName = dbus_name; #if KDBUS_MSG_DECODE_DEBUG == 1 @@ -762,7 +762,7 @@ static int kdbus_decode_msg(const struct kdbus_msg* msg, char *data, DBusTranspo KDBUS_PART_FOREACH(item, msg, items) { - if (item->size <= KDBUS_ITEM_HEADER_SIZE) + if (item->size < KDBUS_ITEM_HEADER_SIZE) { _dbus_verbose(" +%s (%llu bytes) invalid data record\n", enum_MSG(item->type), item->size); break; //??? continue (because dbus will find error) or break |