Fix: potential overflow in ssr (#1600)

This commit is contained in:
bobo liu 2021-09-09 20:30:34 +08:00 committed by GitHub
parent 400dc923e0
commit 0c79d1207e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -278,7 +278,7 @@ func getRandStartPos(length int, random *tools.XorShift128Plus) int {
if length == 0 { if length == 0 {
return 0 return 0
} }
return int(random.Next()%8589934609) % length return int(int64(random.Next()%8589934609) % int64(length))
} }
func (a *authChainA) getRandLength(length int, lastHash []byte, random *tools.XorShift128Plus) int { func (a *authChainA) getRandLength(length int, lastHash []byte, random *tools.XorShift128Plus) int {