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:
parent
e9b41f764b
commit
af7d0c64a8
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue