File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed
Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -248,8 +248,11 @@ fn inner_test_validate_owner(
248248
249249 if expected_owner != owner_account_info. key {
250250 assert_eq ! ( result, Err ( ProgramError :: Custom ( 4 ) ) ) ;
251- result
252- } else if maybe_multisig_is_initialised. is_some ( )
251+ return result;
252+ }
253+ // We add the `maybe_multisig_is_initialised.is_some()` to not branch vacuously in the
254+ // non-multisig cases
255+ else if maybe_multisig_is_initialised. is_some ( )
253256 && owner_account_info. data_len ( ) == Multisig :: LEN
254257 && owner_account_info. owner == & id ( )
255258 {
@@ -287,13 +290,15 @@ fn inner_test_validate_owner(
287290 return result;
288291 }
289292
290- result
291- } else if !owner_account_info. is_signer {
293+ return Ok ( ( ) ) ;
294+ }
295+ // Non-multisig case - check if owner_account_info.is_signer
296+ else if !owner_account_info. is_signer {
292297 assert_eq ! ( result, Err ( ProgramError :: MissingRequiredSignature ) ) ;
293- result
294- } else {
295- result
298+ return result;
296299 }
300+
301+ Ok ( ( ) )
297302}
298303
299304// TODO: Not sure if these are needed since there is no UB like p-token
You can’t perform that action at this time.
0 commit comments