From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ 2/2] gdbus: Fail to send NULL messages
Date: Sun, 28 Jan 2018 11:50:30 -0200 [thread overview]
Message-ID: <20180128135030.18468-2-luiz.dentz@gmail.com> (raw)
In-Reply-To: <20180128135030.18468-1-luiz.dentz@gmail.com>
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This should make it safe to call g_dbus_send_message with a NULL
message which is more likely to happen now that g_dbus_create_reply
returns NULL when the message is marked with NO_REPLY flag.
---
gdbus/object.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/gdbus/object.c b/gdbus/object.c
index e572c9f01..617ab5eda 100644
--- a/gdbus/object.c
+++ b/gdbus/object.c
@@ -1502,6 +1502,9 @@ gboolean g_dbus_send_message(DBusConnection *connection, DBusMessage *message)
{
dbus_bool_t result = FALSE;
+ if (!message)
+ return FALSE;
+
if (dbus_message_get_type(message) == DBUS_MESSAGE_TYPE_METHOD_CALL)
dbus_message_set_no_reply(message, TRUE);
else if (dbus_message_get_type(message) == DBUS_MESSAGE_TYPE_SIGNAL) {
--
2.14.3
next prev parent reply other threads:[~2018-01-28 13:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-28 13:50 [PATCH BlueZ 1/2] gdbus: Fix replying to messages marked with NOREPLY flag Luiz Augusto von Dentz
2018-01-28 13:50 ` Luiz Augusto von Dentz [this message]
2018-01-31 11:33 ` Luiz Augusto von Dentz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180128135030.18468-2-luiz.dentz@gmail.com \
--to=luiz.dentz@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).