Skip to content

Commit

Permalink
flamenco, vm: correct order of error checks in fd_vm_derive_pda
Browse files Browse the repository at this point in the history
  • Loading branch information
topointon-jump committed Aug 30, 2024
1 parent 653406f commit 56e4674
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/flamenco/vm/syscall/fd_vm_syscall_pda.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ fd_vm_derive_pda( fd_vm_t * vm,
uchar * bump_seed,
fd_pubkey_t * out ) {

fd_vm_vec_t const * seeds_haddr = FD_VM_MEM_SLICE_HADDR_LD( vm, seeds_vaddr, FD_VM_VEC_ALIGN, seeds_cnt*FD_VM_VEC_SIZE );

if ( seeds_cnt>FD_VM_PDA_SEEDS_MAX ) {
return FD_VM_ERR_INVAL;
}

fd_vm_vec_t const * seeds_haddr = FD_VM_MEM_SLICE_HADDR_LD( vm, seeds_vaddr, FD_VM_VEC_ALIGN, seeds_cnt*FD_VM_VEC_SIZE );

fd_sha256_init( vm->sha );
for ( ulong i=0UL; i<seeds_cnt; i++ ) {
ulong seed_sz = seeds_haddr[i].len;
Expand Down

0 comments on commit 56e4674

Please sign in to comment.