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
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) {
error_name = dbus_message_get_error_name(r);
if (pa_safe_streq(error_name, HSPHFPD_SERVICE ".AlreadyConnected"))
......@@ -249,6 +244,11 @@ static void hsphfpd_transport_connect_audio_reply(DBusPendingCall *pending, void
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")) {
pa_log_error("Invalid reply signature for " HSPHFPD_ENDPOINT_INTERFACE ".ConnectAudio()");
goto failed;
......@@ -720,13 +720,13 @@ static void hsphfpd_get_endpoints_reply(DBusPendingCall *pending, void *userdata
goto finish;
}
if (!dbus_message_iter_init(r, &arg_i) || !pa_streq(dbus_message_get_signature(r), "a{oa{sa{sv}}}")) {
pa_log_error("Invalid reply signature for GetManagedObjects()");
if (!pa_safe_streq(dbus_message_get_sender(r), hsphfpd->hsphfpd_service_id)) {
pa_log_error("Reply for GetManagedObjects() from invalid sender");
goto finish;
}
if (!pa_safe_streq(dbus_message_get_sender(r), hsphfpd->hsphfpd_service_id)) {
pa_log_error("Reply for GetManagedObjects() from invalid sender");
if (!dbus_message_iter_init(r, &arg_i) || !pa_streq(dbus_message_get_signature(r), "a{oa{sa{sv}}}")) {
pa_log_error("Invalid reply signature for GetManagedObjects()");
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