OSDN Git Service

gdbus: Check for NULL DBusPendingCall in g_dbus_send_message_with_reply
authorSzymon Janc <szymon.janc@tieto.com>
Thu, 26 Sep 2013 08:02:34 +0000 (10:02 +0200)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 14 Oct 2013 11:34:25 +0000 (14:34 +0300)
commit32e2772e8f00ac46dcad71558c791232a5f8cc95
treebc18753262e1068101ea8dfdbe3986405489b47d
parenta753d0c75d56a00868cfbb607bf231d1705989cb
gdbus: Check for NULL DBusPendingCall in g_dbus_send_message_with_reply

"Warning: if the connection is disconnected or you try to send Unix file
descriptors on a connection that does not support them, the
DBusPendingCall will be set to NULL, so be careful with this."

Check this in g_dbus_send_message_with_reply so that callers don't need
to double check for NULL if g_dbus_send_message_with_reply returned
TRUE.

This also fix crash if passing FD over D-Bus is blocked e.g. by SELinux
policy.

bluetoothd[1894]: profiles/audio/avdtp.c:session_cb()
bluetoothd[1894]: profiles/audio/avdtp.c:avdtp_parse_cmd() Received
    SET_CONFIGURATION_CMD
bluetoothd[1894]: profiles/audio/a2dp.c:endpoint_setconf_ind() Source
    0x6c5000: Set_Configuration_Ind
bluetoothd[1894]: profiles/audio/avdtp.c:avdtp_ref() 0x6df360: ref=1
bluetoothd[1894]: profiles/audio/a2dp.c:setup_ref() 0x6d32b0: ref=1
process 1894: arguments to dbus_pending_call_set_notify() were incorrect,
     assertion "pending != NULL" failed in file dbus-pending-call.c line
     636.
This is normally a bug in some application using the D-Bus library.
gdbus/object.c