From 51fb04f6e0303204502974bd5cc748cfa78f553f Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 19 Oct 2018 08:21:51 +0200 Subject: luci-base: cbi.js: fix corner case in IPv6() address parser The implementation allowed a hexadecimal string without any colons. Signed-off-by: Jo-Philipp Wich --- modules/luci-base/htdocs/luci-static/resources/cbi.js | 3 ++- 1 file changed, 2 insertions(+), 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 b92b86f52..6243e5edb 100644 --- a/modules/luci-base/htdocs/luci-static/resources/cbi.js +++ b/modules/luci-base/htdocs/luci-static/resources/cbi.js @@ -106,7 +106,8 @@ function IPv6(x) { var prefix = (prefix_suffix[0] || '0').split(/:/); var suffix = prefix_suffix.length > 1 ? (prefix_suffix[1] || '0').split(/:/) : []; - if (suffix.length ? (prefix.length + suffix.length > 7) : (prefix.length > 8)) + if (suffix.length ? (prefix.length + suffix.length > 7) + : ((prefix_suffix.length < 2 && prefix.length < 8) || prefix.length > 8)) return null; var i, word; -- cgit v1.2.3