Skip to content

Commit 3748c7a

Browse files
committed
Add missing safety comments
1 parent de49b7d commit 3748c7a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: p-token/src/processor/withdraw_excess_lamports.rs

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ pub fn process_withdraw_excess_lamports(accounts: &[AccountInfo]) -> ProgramResu
2222

2323
match source_data.len() {
2424
Account::LEN => {
25+
// SAFETY: `source_data` has the same length as `Account`.
2526
let account = unsafe { load::<Account>(source_data)? };
2627

2728
if account.is_native() {
@@ -31,6 +32,7 @@ pub fn process_withdraw_excess_lamports(accounts: &[AccountInfo]) -> ProgramResu
3132
validate_owner(&account.owner, authority_info, remaining)?;
3233
}
3334
Mint::LEN => {
35+
// SAFETY: `source_data` has the same length as `Mint`.
3436
let mint = unsafe { load::<Mint>(source_data)? };
3537

3638
if let Some(mint_authority) = mint.mint_authority() {

0 commit comments

Comments
 (0)