Deploy error is buffer is too small (#20358)

* Deploy error is buffer is too small

* missing file
This commit is contained in:
Jack May
2021-09-30 19:47:26 -07:00
committed by GitHub
parent fc6b617477
commit de8331eeaf
5 changed files with 124 additions and 81 deletions

View File

@@ -2026,7 +2026,13 @@ fn complete_partial_program_init(
return Err("Buffer account is already executable".into());
}
if account.owner != *loader_id && !system_program::check_id(&account.owner) {
return Err("Buffer account is already owned by another account".into());
return Err("Buffer account passed is already in use by another program".into());
}
if !account.data.is_empty() && account.data.len() < account_data_len {
return Err(
"Buffer account passed is not large enough, may have been for a different deploy?"
.into(),
);
}
if account.data.is_empty() && system_program::check_id(&account.owner) {