From f3a9cfe90a37585af2c062c0b6844eec33c6bce1 Mon Sep 17 00:00:00 2001 From: Grzegorz Kolodziejczyk Date: Fri, 14 Mar 2014 13:46:06 +0100 Subject: [PATCH] android/client: Fix segfault (invalid argv) for gatt scan This patch fix segfault driven by lack of 4 element in avrg array. If user put only two arguments, reading of lacking (auto set to start=1) third argument, will trigger segfault. --- android/client/if-gatt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/client/if-gatt.c b/android/client/if-gatt.c index e8837ffd6..17a491ef2 100644 --- a/android/client/if-gatt.c +++ b/android/client/if-gatt.c @@ -854,7 +854,7 @@ static void scan_p(int argc, const char **argv) VERIFY_CLIENT_IF(2, client_if); /* start */ - if (argc >= 3) + if (argc >= 4) start = atoi(argv[3]); EXEC(if_gatt->client->scan, client_if, start); -- 2.47.3