From 98bda62181b3e9deba7e9ddd85e1fd41ea98de60 Mon Sep 17 00:00:00 2001 From: eraiza0816 <10572974+eraiza0816@users.noreply.github.com> Date: Wed, 9 Sep 2026 17:51:51 +0900 Subject: [PATCH] Fix send_counters validation and changelog --- CHANGELOG.md | 8 +++----- httpd/page_impl.c | 4 +--- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9e5a074..704f1058 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,15 +4,13 @@ ## Added +- Web UI + - Compress the embedded assets (minify + gzip) and switch to a single-page layout. #315 + ## Changed ## Fixed -- Web UI - - `/counters.json` rejects physical port 1 on 9-port devices. - A mapped logical port of `0` was treated as invalid, - but it is a valid port there. - ## Breaking changes - Config diff --git a/httpd/page_impl.c b/httpd/page_impl.c index e0377203..1d725626 100644 --- a/httpd/page_impl.c +++ b/httpd/page_impl.c @@ -299,11 +299,9 @@ void send_vlan(uint16_t vlan) bool send_counters(uint8_t phys_port) { uint8_t phys_port_idx = phys_port - 1; - if (phys_port_idx > 8) + if (phys_port_idx > (machine.max_port - machine.min_port)) goto err; uint8_t log_port = machine.phys_to_log_port[phys_port_idx]; - if (log_port < machine.min_port || log_port > machine.max_port) - goto err; dbg_string("send_counters called: "); dbg_byte(phys_port_idx); dbg_char('\n'); slen = strtox(outbuf, HTTP_RESPONCE_JSON);