Skip to content

Commit

Permalink
Validate gpio in gpio command
Browse files Browse the repository at this point in the history
  • Loading branch information
whowechina committed Apr 29, 2024
1 parent ed44780 commit 9d5165a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
Binary file modified Production/firmware/mai_pico.uf2
Binary file not shown.
2 changes: 1 addition & 1 deletion firmware/src/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ static void handle_gpio(int argc, char *argv[])
uint8_t gpio_main[8];
for (int i = 0; i < 8; i++) {
int gpio = cli_extract_non_neg_int(argv[i + 1], 0);
if (gpio > 29) {
if ((gpio < 0) || (gpio > 29)) {
printf(usage);
return;
}
Expand Down

0 comments on commit 9d5165a

Please sign in to comment.