From: Jo-Philipp Wich Date: Thu, 15 Jul 2021 06:13:31 +0000 (+0200) Subject: luci-base: fix off-by-one in cbi_update_table() X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=5806ff053151a2052b9eef86856e48f9ac033e7d;p=project%2Fluci.git 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) --- 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