Skip to content

Commit

Permalink
fix: adding validation in process unlock (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
wei3erHase authored Oct 7, 2024
1 parent c5ca462 commit 6c0fd6d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions program/src/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,12 @@ impl Processor {
return Err(ProgramError::InvalidArgument);
}

// Validate that the vesting account is owned by the program
if *vesting_account.owner != *program_id {
msg!("Vesting account is not owned by this program");
return Err(ProgramError::InvalidArgument);
}

// Validate that the vesting account public key is derived from the seeds
let vesting_account_key = Pubkey::create_program_address(&[&seeds], program_id)?;
if vesting_account_key != *vesting_account.key {
Expand Down

0 comments on commit 6c0fd6d

Please sign in to comment.