Merge pull request #656 from fooooxxxx/fix/timeout-integer-overflow

修复 SaLoginModel 的 timeout 超出整型范围时返回负数导致 Cookie 被设置为 会话期Cookie 的问题
This commit is contained in:
click33
2024-08-27 10:07:46 +08:00
committed by GitHub

View File

@@ -300,6 +300,9 @@ public class SaLoginModel {
if(getTimeoutOrGlobalConfig() == SaTokenDao.NEVER_EXPIRE) {
return Integer.MAX_VALUE;
}
if (timeout > Integer.MAX_VALUE) {
return Integer.MAX_VALUE;
}
return (int)(long)timeout;
}