Realloc not supported (#11424)

This commit is contained in:
Jack May 2020-08-06 12:14:12 -07:00 committed by GitHub
parent c7a2fbe7eb
commit 4ac75a8558
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

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);
}
}