mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-05-04 20:30:36 +00:00
Merge pull request #181 from alexbakker/fix-152
Check for the possibility of an overflow when parsing OTP period
This commit is contained in:
commit
e3b9b67fee
1 changed files with 6 additions and 1 deletions
|
@ -55,7 +55,12 @@ public class TotpInfo extends OtpInfo {
|
|||
}
|
||||
|
||||
public static boolean isPeriodValid(int period) {
|
||||
return period > 0;
|
||||
if (period <= 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// check for the possibility of an overflow when converting to milliseconds
|
||||
return period <= Integer.MAX_VALUE / 1000;
|
||||
}
|
||||
|
||||
public void setPeriod(int period) throws OtpInfoException {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue