Check CPI program is executable (#12644)

This commit is contained in:
Jack May
2020-10-02 13:55:22 -07:00
committed by GitHub
parent 19f385db76
commit adeb06e550
5 changed files with 59 additions and 11 deletions

View File

@ -1088,6 +1088,9 @@ fn call<'a>(
// Process instruction
let program_account = (*accounts[callee_program_id_index]).clone();
if !program_account.borrow().executable {
return Err(SyscallError::InstructionError(InstructionError::AccountNotExecutable).into());
}
let executable_accounts = vec![(callee_program_id, program_account)];
let mut message_processor = MessageProcessor::default();
for (program_id, process_instruction) in invoke_context.get_programs().iter() {