Bluetooth: shell: Fix accessing invalid memory

argc needs to be check before accessing argv.

Change-Id: I9cb70906a388b96df4e192dd4f31eafdab25127f
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
This commit is contained in:
Szymon Janc 2017-02-13 20:38:13 +01:00 committed by Johan Hedberg
parent e9b41f764b
commit af7d0c64a8
1 changed files with 4 additions and 0 deletions

View File

@ -1404,6 +1404,10 @@ static bool hrs_simulate;
static int cmd_hrs_simulate(int argc, char *argv[])
{
if (argc < 2) {
return -EINVAL;
}
if (!strcmp(argv[1], "on")) {
static bool hrs_registered;