Skip to content

Commit

Permalink
fix(authority): OS-SQD-SUG-01
Browse files Browse the repository at this point in the history
  • Loading branch information
ogmedia committed Jul 22, 2022
1 parent 2220864 commit d200f3d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion programs/squads-mpl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,10 @@ pub mod squads_mpl {
match ctx.accounts.transaction.authority_index {
// if its a 0 authority, use the MS pda seeds
0 => {
invoke_signed(
if &ix.program_id != ctx.program_id {
return err!(MsError::InvalidAuthorityIndex);
}
invoke_signed(
&ix,
&ix_account_infos,
&[&ms_authority_seeds]
Expand Down Expand Up @@ -430,6 +433,10 @@ pub mod squads_mpl {
ix_account_infos.push(ix_account_info.clone());
}

if tx.authority_index < 1 && &ix.program_id != ctx.program_id {
return err!(MsError::InvalidAuthorityIndex);
}

invoke_signed(
&ix,
&ix_account_infos,
Expand Down

0 comments on commit d200f3d

Please # to comment.