summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormorrishoresh <morris_horesh@yahoo.com>2020-12-24 23:58:54 +0200
committerArun Raghavan <arun@asymptotic.io>2021-01-07 19:17:57 -0500
commit0f89157261d032fbf7f9c5e8f94d92730ffea1ad (patch)
tree334b8448e68106d13f489ba0a7ce4a932e1841bb
parent254cb4bd1f0905270f77462d766c88bf39ccf8a5 (diff)
downloadpulseaudio-0f89157261d032fbf7f9c5e8f94d92730ffea1ad.tar.gz
bluetooth: correct possible segmentation fault
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/443>
-rw-r--r--src/modules/bluetooth/backend-ofono.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/modules/bluetooth/backend-ofono.c b/src/modules/bluetooth/backend-ofono.c
index 0e5bbe8b7..d7a13efd0 100644
--- a/src/modules/bluetooth/backend-ofono.c
+++ b/src/modules/bluetooth/backend-ofono.c
@@ -627,8 +627,6 @@ static DBusMessage *hf_audio_agent_new_connection(DBusConnection *c, DBusMessage
card = pa_hashmap_get(backend->cards, path);
- card->connecting = false;
-
if (!card || codec != HFP_AUDIO_CODEC_CVSD || card->fd >= 0) {
pa_log_warn("New audio connection invalid arguments (path=%s fd=%d, codec=%d)", path, fd, codec);
pa_assert_se(r = dbus_message_new_error(m, "org.ofono.Error.InvalidArguments", "Invalid arguments in method call"));
@@ -639,6 +637,7 @@ static DBusMessage *hf_audio_agent_new_connection(DBusConnection *c, DBusMessage
pa_log_debug("New audio connection on card %s (fd=%d, codec=%d)", path, fd, codec);
+ card->connecting = false;
card->fd = fd;
card->transport->codec = codec;