Merge pull request #354 from DrDoof/fix/isolate-cpu-port

port: reject the CPU port in isolate instead of refusing it silently
This commit is contained in:
René van Dorst
2026-08-17 18:31:25 +00:00
committed by GitHub
+5 -5
View File
@@ -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');