From 5806ff053151a2052b9eef86856e48f9ac033e7d Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 15 Jul 2021 08:13:31 +0200 Subject: [PATCH] luci-base: fix off-by-one in cbi_update_table() Fixes: #5189 Fixes: f919635310 ("luci-base: batch DOM updates to prevent slowdown") Ref: https://github.com/openwrt/luci/commit/f919635310286b3b905aedb716d707da1ea2c811#commitcomment-53495580 Signed-off-by: Jo-Philipp Wich (cherry picked from commit 7d9ab8d4a741cbc97e9553982e9e352b21ddf5f3) --- modules/luci-base/htdocs/luci-static/resources/cbi.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/luci-base/htdocs/luci-static/resources/cbi.js b/modules/luci-base/htdocs/luci-static/resources/cbi.js index 2fc2f09632..513256e4c9 100644 --- a/modules/luci-base/htdocs/luci-static/resources/cbi.js +++ b/modules/luci-base/htdocs/luci-static/resources/cbi.js @@ -773,7 +773,7 @@ function cbi_update_table(table, data, placeholder) { trows[n] = trow; }); - for (var i = 1; i < n; i++) { + for (var i = 1; i <= n; i++) { if (rows[i]) target.replaceChild(trows[i], rows[i]); else