From 67eccade2d38f790b0698b6e2cbcd6282b21e534 Mon Sep 17 00:00:00 2001 From: Grzegorz Kolodziejczyk Date: Wed, 29 Apr 2015 11:15:53 +0200 Subject: [PATCH] android/gatt: Fix updating mtu for no registered app Gatt shouldn't notify about updating mtu if no apps are registered. Without this patch, while connecting crash can occur. --- android/gatt.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/android/gatt.c b/android/gatt.c index 625b7dfbf..b8074a937 100644 --- a/android/gatt.c +++ b/android/gatt.c @@ -978,6 +978,11 @@ static void notify_mtu_change(void *data, void *user_data) if (conn->device != device) return; + if (!conn->app) { + error("gatt: can't notify mtu - no app registered for conn"); + return; + } + switch (conn->app->type) { case GATT_CLIENT: notify_client_mtu_change(conn, true); -- 2.47.3