From 14f93a68ba38aedb59c877d6c62eee17a89a2b7b Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Tue, 24 May 2016 14:09:34 +0300 Subject: [PATCH] profile: Fix accepting connections without an associated service This fixes the flawed logic from the following commit: commit b669604f43bbbf04ebaa66dd14ad9cfb005e561b Author: Hsin-Yu Chao Date: Fri Apr 24 10:36:09 2015 -0700 src/profile: Set service to connecting in ext_connect --- src/profile.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/profile.c b/src/profile.c index 5a4f09ce9..c81a9f908 100644 --- a/src/profile.c +++ b/src/profile.c @@ -1047,10 +1047,11 @@ static void ext_connect(GIOChannel *io, GError *err, gpointer user_data) conn); } - if (conn->service && service_accept(conn->service) == 0) { - if (send_new_connection(ext, conn)) - return; - } + if (conn->service && service_accept(conn->service) < 0) + goto drop; + + if (send_new_connection(ext, conn)) + return; drop: if (conn->service) -- 2.47.3