Handle error when configuration file cmd too long

This commit is contained in:
logicog
2026-04-14 18:00:29 +02:00
parent 4440bcc43a
commit c3530aaafc
+7
View File
@@ -1190,6 +1190,13 @@ void execute_config(void) __banked
if (!cfg_idx) if (!cfg_idx)
break; break;
} }
if (cmd_idx >= (CMD_BUF_SIZE - 1)) {
cmd_buffer[cmd_idx] = '\0';
print_string("ERROR: Command too long: ");
print_string_x(cmd_buffer);
write_char('\n');
goto config_done;
}
len_left -= FLASH_READ_BURST_SIZE; len_left -= FLASH_READ_BURST_SIZE;
pos += FLASH_READ_BURST_SIZE; pos += FLASH_READ_BURST_SIZE;