Skip to content

Commit

Permalink
Add panic message if too many accounts provided
Browse files Browse the repository at this point in the history
  • Loading branch information
joncinque committed Aug 21, 2024
1 parent c51cf11 commit 5abfb5f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sdk/program/src/entrypoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,14 @@ pub unsafe fn deserialize_into<'a>(
let num_accounts = *(input.add(offset) as *const u64) as usize;
offset += size_of::<u64>();

if num_accounts > accounts.len() {
panic!(
"{} accounts provided, but only {} are supported",
num_accounts,
accounts.len()
);
}

// Account Infos

for i in 0..num_accounts {
Expand Down

0 comments on commit 5abfb5f

Please sign in to comment.