FV-ANC-3-CL9 Using ctx.remaining_accounts without manual discriminator check
Bad
let extra_account = &ctx.remaining_accounts[0];
// No check for account type discriminator.
Good
let extra_account = &ctx.remaining_accounts[0];
let data = extra_account.try_borrow_data()?;
if &data[..8] != MyAccountType::DISCRIMINATOR {
return Err(ProgramError::InvalidAccountData);
}
PreviousFV-ANC-3-CL8 Using ctx.remaining_accounts without manual ownership checkNextFV-ANC-3-CL10 Using ctx.remaining_accounts without non-zero data check
Last updated
Was this helpful?