Realloc not supported (#11418)

(cherry picked from commit bc4c5c5a97)

Co-authored-by: Jack May <jack@solana.com>
This commit is contained in:
mergify[bot]
2020-08-06 16:24:14 +00:00
committed by GitHub
parent 1a186beb5c
commit a8de467ef8

View File

@ -847,6 +847,12 @@ fn call<'a>(
let account = account.borrow();
if message.is_writable(i) && !account.executable {
*lamport_ref = account.lamports;
if data.len() != account.data.len() {
return Err(SyscallError::InstructionError(
InstructionError::AccountDataSizeChanged,
)
.into());
}
data.clone_from_slice(&account.data);
}
}