diff options
author | Jo-Philipp Wich <jo@mein.io> | 2018-10-19 08:21:51 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2018-11-05 11:01:45 +0100 |
commit | 51fb04f6e0303204502974bd5cc748cfa78f553f (patch) | |
tree | 5647340b06896e47f9c564a668ac43abd01e7b97 /modules/luci-base | |
parent | 7f613be5000e753e99ce5b829748fb43fca78754 (diff) |
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 <jo@mein.io>
Diffstat (limited to 'modules/luci-base')
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/cbi.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/cbi.js b/modules/luci-base/htdocs/luci-static/resources/cbi.js index b92b86f523..6243e5edbf 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; |