[PATCH] android/client: Fix crash in get_profile_interface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This fixes crash due to uncheck input from user.
---
 android/client/if-bt.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/android/client/if-bt.c b/android/client/if-bt.c
index a3d6286..9e01d65 100644
--- a/android/client/if-bt.c
+++ b/android/client/if-bt.c
@@ -804,11 +804,16 @@ static void get_profile_interface_c(int argc, const char **argv,
 
 static void get_profile_interface_p(int argc, const char **argv)
 {
-	const char *id = argv[2];
+	const char *id;
 	const void **pif = NULL;
 	const void *dummy = NULL;
 
 	RETURN_IF_NULL(if_bluetooth);
+	if (argc <= 2) {
+		haltest_error("No interface specified\n");
+		return;
+	}
+	id = argv[2];
 
 	if (strcmp(BT_PROFILE_HANDSFREE_ID, id) == 0)
 		pif = (const void **) &if_hf;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux