@@ -50,7 +50,8 @@ pub fn process_set_authority(accounts: &[AccountInfo], instruction_data: &[u8])
5050
5151 match authority_type {
5252 AuthorityType :: AccountOwner => {
53- validate_owner ( & account. owner , authority_info, remaining) ?;
53+ // SAFETY: `authority_info` is not currently borrowed.
54+ unsafe { validate_owner ( & account. owner , authority_info, remaining) ? } ;
5455
5556 if let Some ( authority) = new_authority {
5657 account. owner = * authority;
@@ -67,7 +68,8 @@ pub fn process_set_authority(accounts: &[AccountInfo], instruction_data: &[u8])
6768 }
6869 AuthorityType :: CloseAccount => {
6970 let authority = account. close_authority ( ) . unwrap_or ( & account. owner ) ;
70- validate_owner ( authority, authority_info, remaining) ?;
71+ // SAFETY: `authority_info` is not currently borrowed.
72+ unsafe { validate_owner ( authority, authority_info, remaining) ? } ;
7173
7274 if let Some ( authority) = new_authority {
7375 account. set_close_authority ( authority) ;
@@ -90,7 +92,8 @@ pub fn process_set_authority(accounts: &[AccountInfo], instruction_data: &[u8])
9092 // mint_authority.
9193 let mint_authority = mint. mint_authority ( ) . ok_or ( TokenError :: FixedSupply ) ?;
9294
93- validate_owner ( mint_authority, authority_info, remaining) ?;
95+ // SAFETY: `authority_info` is not currently borrowed.
96+ unsafe { validate_owner ( mint_authority, authority_info, remaining) ? } ;
9497
9598 if let Some ( authority) = new_authority {
9699 mint. set_mint_authority ( authority) ;
@@ -105,7 +108,8 @@ pub fn process_set_authority(accounts: &[AccountInfo], instruction_data: &[u8])
105108 . freeze_authority ( )
106109 . ok_or ( TokenError :: MintCannotFreeze ) ?;
107110
108- validate_owner ( freeze_authority, authority_info, remaining) ?;
111+ // SAFETY: `authority_info` is not currently borrowed.
112+ unsafe { validate_owner ( freeze_authority, authority_info, remaining) ? } ;
109113
110114 if let Some ( authority) = new_authority {
111115 mint. set_freeze_authority ( authority) ;
0 commit comments