From 47b3ee60b6b6a3a89202eb232e30d04aed677f2a Mon Sep 17 00:00:00 2001 From: d00f <8052722+DrDoof@users.noreply.github.com> Date: Mon, 17 Aug 2026 10:53:17 +0200 Subject: [PATCH] port: reject the CPU port in isolate instead of refusing it silently parse_isolate() accepted a two digit port and mapped it to logical port 9, the CPU port, while port_isolate() and port_isolation_get() both refuse anything above machine.max_port. Setting the isolation of the CPU port was therefore declined without a word and reading it always answered no members, whatever the hardware held. Bound the port to the front panel, so the command says what it does. The digit is checked before it indexes phys_to_log_port[], which a non numeric argument used to read past. --- cmd_parser.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd_parser.c b/cmd_parser.c index 996e743..afb14fb 100644 --- a/cmd_parser.c +++ b/cmd_parser.c @@ -428,11 +428,11 @@ void parse_isolate(void) print_string("\nISOLATE "); - __xdata int8_t port_configured = cmd_buffer[cmd_words_b[1]] - '1'; - port_configured = machine.phys_to_log_port[port_configured]; - if (isnumber(cmd_buffer[cmd_words_b[1] + 1])) // CPU-port, logical port 9 - port_configured = (port_configured + 1) * 10 + cmd_buffer[cmd_words_b[1] + 1] - '1'; - if (port_configured < 0 || port_configured > 9) + if (!isnumber(cmd_buffer[cmd_words_b[1]]) || cmd_buffer[cmd_words_b[1]] == '0' + || isnumber(cmd_buffer[cmd_words_b[1] + 1])) + goto err; + __xdata uint8_t port_configured = machine.phys_to_log_port[cmd_buffer[cmd_words_b[1]] - '1']; + if (port_configured < machine.min_port || port_configured > machine.max_port) goto err; print_byte(port_configured); write_char('\n');