Check CPI program is executable (#12644) (#12649)

(cherry picked from commit adeb06e550)

Co-authored-by: Jack May <jack@solana.com>
This commit is contained in:
mergify[bot]
2020-10-02 22:27:29 +00:00
committed by GitHub
parent bd94250fca
commit a983430ddb
5 changed files with 59 additions and 11 deletions

View File

@@ -1037,6 +1037,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() {