Skip to content

Commit

Permalink
[wip]: Add executable check
Browse files Browse the repository at this point in the history
  • Loading branch information
febo committed Jan 11, 2025
1 parent 3dd5d15 commit 313972c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions program/src/processor/allocate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ pub fn allocate(accounts: &[AccountInfo], instruction_data: &[u8]) -> ProgramRes
if instruction_data.len() != SEED_LEN {
return Err(ProgramError::InvalidInstructionData);
}
// And an executable program account.
if !program.executable() {
// TODO: use custom error (not executable program account)
return Err(ProgramError::InvalidAccountData);
}
let canonical = is_program_authority(program, program_data, authority.key())?;

let seeds: &[&[u8]] = if canonical {
Expand Down

0 comments on commit 313972c

Please sign in to comment.