Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 23c487d

Browse files
committed
lending: add extra owner check
1 parent e8861b2 commit 23c487d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

token-lending/program/src/processor.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1567,6 +1567,10 @@ fn process_flash_loan(
15671567
}
15681568

15691569
let mut reserve = Reserve::unpack(&reserve_info.data.borrow())?;
1570+
if reserve_info.owner != program_id {
1571+
msg!("Reserve provided is not owned by the lending program");
1572+
return Err(LendingError::InvalidAccountOwner.into());
1573+
}
15701574
if &reserve.lending_market != lending_market_info.key {
15711575
msg!("Invalid reserve lending market account");
15721576
return Err(LendingError::InvalidAccountInput.into());

0 commit comments

Comments
 (0)