Skip to content

Commit

Permalink
Don't panic vote program if epoch number overflows (#730)
Browse files Browse the repository at this point in the history
Helps with fuzzing

Co-authored-by: Richard Patel <[email protected]>
  • Loading branch information
ripatel-fd and riptl authored Apr 11, 2024
1 parent 55ab7fa commit 16efe51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion programs/vote/src/vote_state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 16efe51

Please sign in to comment.