Commit 18193e4f authored by pali's avatar pali

bluetooth: Fix order when checking sender of hsphfpd dbus message

parent 76105b07
...@@ -234,11 +234,6 @@ static void hsphfpd_transport_connect_audio_reply(DBusPendingCall *pending, void ...@@ -234,11 +234,6 @@ static void hsphfpd_transport_connect_audio_reply(DBusPendingCall *pending, void
dbus_error_init(&error); dbus_error_init(&error);
if (!pa_safe_streq(dbus_message_get_sender(r), hsphfpd->hsphfpd_service_id)) {
pa_log_error("Reply for " HSPHFPD_ENDPOINT_INTERFACE ".ConnectAudio() from invalid sender");
goto failed;
}
if (dbus_message_get_type(r) == DBUS_MESSAGE_TYPE_ERROR) { if (dbus_message_get_type(r) == DBUS_MESSAGE_TYPE_ERROR) {
error_name = dbus_message_get_error_name(r); error_name = dbus_message_get_error_name(r);
if (pa_safe_streq(error_name, HSPHFPD_SERVICE ".AlreadyConnected")) if (pa_safe_streq(error_name, HSPHFPD_SERVICE ".AlreadyConnected"))
...@@ -249,6 +244,11 @@ static void hsphfpd_transport_connect_audio_reply(DBusPendingCall *pending, void ...@@ -249,6 +244,11 @@ static void hsphfpd_transport_connect_audio_reply(DBusPendingCall *pending, void
goto failed; goto failed;
} }
if (!pa_safe_streq(dbus_message_get_sender(r), hsphfpd->hsphfpd_service_id)) {
pa_log_error("Reply for " HSPHFPD_ENDPOINT_INTERFACE ".ConnectAudio() from invalid sender");
goto failed;
}
if (!pa_streq(dbus_message_get_signature(r), "oso")) { if (!pa_streq(dbus_message_get_signature(r), "oso")) {
pa_log_error("Invalid reply signature for " HSPHFPD_ENDPOINT_INTERFACE ".ConnectAudio()"); pa_log_error("Invalid reply signature for " HSPHFPD_ENDPOINT_INTERFACE ".ConnectAudio()");
goto failed; goto failed;
...@@ -720,13 +720,13 @@ static void hsphfpd_get_endpoints_reply(DBusPendingCall *pending, void *userdata ...@@ -720,13 +720,13 @@ static void hsphfpd_get_endpoints_reply(DBusPendingCall *pending, void *userdata
goto finish; goto finish;
} }
if (!dbus_message_iter_init(r, &arg_i) || !pa_streq(dbus_message_get_signature(r), "a{oa{sa{sv}}}")) { if (!pa_safe_streq(dbus_message_get_sender(r), hsphfpd->hsphfpd_service_id)) {
pa_log_error("Invalid reply signature for GetManagedObjects()"); pa_log_error("Reply for GetManagedObjects() from invalid sender");
goto finish; goto finish;
} }
if (!pa_safe_streq(dbus_message_get_sender(r), hsphfpd->hsphfpd_service_id)) { if (!dbus_message_iter_init(r, &arg_i) || !pa_streq(dbus_message_get_signature(r), "a{oa{sa{sv}}}")) {
pa_log_error("Reply for GetManagedObjects() from invalid sender"); pa_log_error("Invalid reply signature for GetManagedObjects()");
goto finish; goto finish;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment