Don't panic vote program if epoch number overflows (#730)

Helps with fuzzing

Co-authored-by: Richard Patel <ripatel@jumptrading.com>
This commit is contained in:
ripatel-fd 2024-04-11 04:56:19 +02:00 committed by GitHub
parent 55ab7fadbc
commit 16efe510cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -860,7 +860,7 @@ pub fn authorize<S: std::hash::BuildHasher>(
clock
.leader_schedule_epoch
.checked_add(1)
.expect("epoch should be much less than u64::MAX"),
.ok_or(InstructionError::InvalidAccountData)?,
|epoch_authorized_voter| {
// current authorized withdrawer or authorized voter must say "yay"
if authorized_withdrawer_signer {