drivers: w1: shell: fix off-by-one error
Prevent user to use and invalid setting index Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
This commit is contained in:
parent
d048806bf6
commit
bb3a898dec
@ -317,7 +317,7 @@ static int cmd_w1_configure(const struct shell *sh, size_t argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
if (type > W1_SETINGS_TYPE_COUNT) {
|
||||
if (type >= W1_SETINGS_TYPE_COUNT) {
|
||||
shell_error(sh, "invalid type %u", type);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user