From 6c0fd6d6fec3881235678e5dc6d2b474305979a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wei=C3=9Fer=20Hase?= Date: Mon, 7 Oct 2024 14:20:12 +0200 Subject: [PATCH] fix: adding validation in process unlock (#24) --- program/src/processor.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/program/src/processor.rs b/program/src/processor.rs index 4628dcf..db5b681 100644 --- a/program/src/processor.rs +++ b/program/src/processor.rs @@ -269,6 +269,12 @@ impl Processor { return Err(ProgramError::InvalidArgument); } + // Validate that the vesting account is owned by the program + if *vesting_account.owner != *program_id { + msg!("Vesting account is not owned by this program"); + return Err(ProgramError::InvalidArgument); + } + // Validate that the vesting account public key is derived from the seeds let vesting_account_key = Pubkey::create_program_address(&[&seeds], program_id)?; if vesting_account_key != *vesting_account.key {