1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

builtin,crypto: fix problems detected by -fsanitize=address,undefined and -fsanitize=memory

This commit is contained in:
Delyan Angelov
2021-11-28 20:35:18 +02:00
parent b4c52b72cf
commit 31fe02de8c
5 changed files with 28 additions and 19 deletions

View File

@ -119,7 +119,8 @@ fn encrypt_block(l u32, r u32, mut bf Blowfish) []u32 {
xl ^= ((bf.s[0][byte(xr >> 24)] + bf.s[1][byte(xr >> 16)]) ^ bf.s[2][byte(xr >> 8)]) +
(bf.s[3][byte(xr)] ^ bf.p[16])
xr ^= bf.p[17]
return [xl, xr]
res := [xl, xr]
return res
}
fn get_next_word(b []byte, pos &int) u32 {