summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorseungha.son <seungha.son@samsung.com>2017-01-25 17:09:23 +0900
committerseungha.son <seungha.son@samsung.com>2017-02-01 07:30:13 +0900
commit681bbfaf8205b444a4d0c5e0b3b092d53151fb1d (patch)
tree584c79d545ac70d10e3d95a2b891256e6a178418
parent3f50d6575b51c01b7cc20ee19e1a55da512d6f30 (diff)
downloadnotification-681bbfaf8205b444a4d0c5e0b3b092d53151fb1d.tar.gz
notification-681bbfaf8205b444a4d0c5e0b3b092d53151fb1d.tar.bz2
notification-681bbfaf8205b444a4d0c5e0b3b092d53151fb1d.zip
- If body is floating, memory corruption is occured when msg get body in g_dbus_connection_send_message_with_reply() So, this problem can be solved by increase reference count of body when body is floating. Signed-off-by: seungha.son <seungha.son@samsung.com> Change-Id: Ifaffa3153b111d91a8e20c6ad5c9e228548983c9
-rwxr-xr-xsrc/notification_ipc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/notification_ipc.c b/src/notification_ipc.c
index 540b3b6..fdecf6f 100755
--- a/src/notification_ipc.c
+++ b/src/notification_ipc.c
@@ -792,6 +792,9 @@ static int _send_async_noti(GVariant *body, result_cb_item *cb_item, char *cmd)
/* LCOV_EXCL_STOP */
}
+ if (g_variant_is_floating(body))
+ g_variant_ref(body);
+
if (body != NULL)
g_dbus_message_set_body(msg, body);
@@ -805,6 +808,9 @@ static int _send_async_noti(GVariant *body, result_cb_item *cb_item, char *cmd)
(GAsyncReadyCallback)_send_message_with_reply_async_cb,
cb_item);
+ if (msg)
+ g_object_unref(msg);
+
NOTIFICATION_DBG("_send_async_noti done !!");
return NOTIFICATION_ERROR_NONE;
}