projects
/
oweals
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2babc47
)
luci-base: cbi.js: fix sfh() signedness bug for strings with 3 trailing bytes
author
Jo-Philipp Wich
<jo@mein.io>
Mon, 19 Nov 2018 10:58:17 +0000
(11:58 +0100)
committer
Jo-Philipp Wich
<jo@mein.io>
Mon, 19 Nov 2018 10:58:17 +0000
(11:58 +0100)
Replace a sign-propagating right shift by a zero-filling right shift to avoid
calculating a wrong hash code in the three-trailing-bytes case.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/htdocs/luci-static/resources/cbi.js
patch
|
blob
|
history
diff --git
a/modules/luci-base/htdocs/luci-static/resources/cbi.js
b/modules/luci-base/htdocs/luci-static/resources/cbi.js
index 6cd799b92222881bc0d63153c327dc604cbd597c..0e959068129a540496c641b99dc24393b7c41470 100644
(file)
--- a/
modules/luci-base/htdocs/luci-static/resources/cbi.js
+++ b/
modules/luci-base/htdocs/luci-static/resources/cbi.js
@@
-60,7
+60,7
@@
function sfh(s) {
hash += ((bytes[off + 1] << 8) + bytes[off]) >>> 0;
hash = (hash ^ (hash << 16)) >>> 0;
hash = (hash ^ (bytes[off + 2] << 18)) >>> 0;
- hash += hash >> 11;
+ hash += hash >>
>
11;
break;
case 2: