Package: bluez-tools
Version: 2.0~20170911.0.7cb788c-4
Severity: normal
Tags: patch

Dear Maintainer,

bt-network exits with SEGV when connection fails.
The patch should fix that.

Also there is a patch for a typo (brige -> bridge)
diff --git a/src/lib/bluez/network.c b/src/lib/bluez/network.c
index 02a33fb..19658b0 100644
--- a/src/lib/bluez/network.c
+++ b/src/lib/bluez/network.c
@@ -173,7 +173,7 @@ const gchar *network_connect(Network *self, const gchar 
*uuid, GError **error)
        g_assert(NETWORK_IS(self));
        const gchar *ret = NULL;
        GVariant *proxy_ret = g_dbus_proxy_call_sync(self->priv->proxy, 
"Connect", g_variant_new ("(s)", uuid), G_DBUS_CALL_FLAGS_NONE, -1, NULL, 
error);
-       if (proxy_ret != NULL)
+       if (proxy_ret == NULL)
                return NULL;
        proxy_ret = g_variant_get_child_value(proxy_ret, 0);
        ret = g_variant_get_string(proxy_ret, NULL);
diff --git a/contrib/man/bt-network.pod b/contrib/man/bt-network.pod
index 0bde301..189277e 100644
--- a/contrib/man/bt-network.pod
+++ b/contrib/man/bt-network.pod
@@ -12,7 +12,7 @@ Help Options:
 Application Options:
   -a, --adapter=<name|mac>
   -c, --connect <name|mac> <uuid>
-  -s, --server <gn|panu|nap> <brige>
+  -s, --server <gn|panu|nap> <bridge>
 
 =head1 DESCRIPTION
 
@@ -32,7 +32,7 @@ B<-c, --connect E<lt>name|macE<gt> E<lt>uuidE<gt>>
     Connect to the network device and return the network interface
     name, uuid can be either one of "gn", "panu" or "nap"
 
-B<-s, --server E<lt>gn|panu|napE<gt> E<lt>brigeE<gt>>
+B<-s, --server E<lt>gn|panu|napE<gt> E<lt>bridgeE<gt>>
     Register server for the provided UUID, every new connection to
     this server will be added the bridge interface
 
diff --git a/src/bt-network.1 b/src/bt-network.1
index 0a6381c..b346d02 100644
--- a/src/bt-network.1
+++ b/src/bt-network.1
@@ -150,7 +150,7 @@ Help Options:
 Application Options:
   \-a, \-\-adapter=<name|mac>
   \-c, \-\-connect <name|mac> <uuid>
-  \-s, \-\-server <gn|panu|nap> <brige>
+  \-s, \-\-server <gn|panu|nap> <bridge>
 .SH "DESCRIPTION"
 .IX Header "DESCRIPTION"
 This utility is used to manage network services (client/server).
@@ -168,7 +168,7 @@ All servers will be automatically unregistered when the 
application terminates.
     Connect to the network device and return the network interface
     name, uuid can be either one of \*(L"gn\*(R", \*(L"panu\*(R" or 
\*(L"nap\*(R"
 .PP
-\&\fB\-s, \-\-server <gn|panu|nap> <brige>\fR
+\&\fB\-s, \-\-server <gn|panu|nap> <bridge>\fR
     Register server for the provided \s-1UUID,\s0 every new connection to
     this server will be added the bridge interface
 .SH "AUTHOR"
diff --git a/src/bt-network.c b/src/bt-network.c
index d8de8a1..6385f8f 100644
--- a/src/bt-network.c
+++ b/src/bt-network.c
@@ -90,7 +90,7 @@ static gchar *connect_device_arg = NULL;
 static gchar *connect_uuid_arg = NULL;
 static gboolean server_arg = FALSE;
 static gchar *server_uuid_arg = NULL;
-static gchar *server_brige_arg = NULL;
+static gchar *server_bridge_arg = NULL;
 static gboolean daemon_arg = FALSE;
 
 static GOptionEntry entries[] = {
@@ -122,7 +122,7 @@ int main(int argc, char *argv[])
                        "    `uuid` is:\n"
                        "       Profile short name: gn, panu or nap\n\n"
                        "Server Options:\n"
-                       "  -s, --server <gn|panu|nap> <brige>\n"
+                       "  -s, --server <gn|panu|nap> <bridge>\n"
                        "  Every new connection to this server will be added 
the `bridge` interface\n\n"
                        "Report bugs to <"PACKAGE_BUGREPORT">."
                        "Project home page <"PACKAGE_URL">."
@@ -200,7 +200,7 @@ int main(int argc, char *argv[])
                g_object_unref(device);
        } else if (server_arg) {
                server_uuid_arg = argv[1];
-               server_brige_arg = argv[2];
+               server_bridge_arg = argv[2];
 
                if (g_ascii_strcasecmp(server_uuid_arg, "gn") != 0 && 
g_ascii_strcasecmp(server_uuid_arg, "panu") != 0 && 
g_ascii_strcasecmp(server_uuid_arg, "nap") != 0) {
                        g_print("%s: Invalid server UUID: %s\n", 
g_get_prgname(), server_uuid_arg);
@@ -216,7 +216,7 @@ int main(int argc, char *argv[])
                gchar *server_uuid_upper = g_ascii_strup(server_uuid_arg, -1);
 
                 NetworkServer *network_server = 
network_server_new(adapter_get_dbus_object_path(adapter));
-               network_server_register(network_server, server_uuid_arg, 
server_brige_arg, &error);
+               network_server_register(network_server, server_uuid_arg, 
server_bridge_arg, &error);
                exit_if_error(error);
                g_print("%s server registered\n", server_uuid_upper);
 

Reply via email to