* [PATCH] android/client: Fix crash in get_profile_interface
@ 2013-10-31 10:56 Jerzy Kasenberg
2013-10-31 11:52 ` Johan Hedberg
0 siblings, 1 reply; 2+ messages in thread
From: Jerzy Kasenberg @ 2013-10-31 10:56 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Jerzy Kasenberg
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-10-31 11:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-31 10:56 [PATCH] android/client: Fix crash in get_profile_interface Jerzy Kasenberg
2013-10-31 11:52 ` Johan Hedberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox