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
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue