From fd61a0392f80e302c541acc98d398ab3f6b9cb15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Wed, 27 Jul 2022 14:31:23 +0900 Subject: [PATCH] fix: Off-by one check on offchain config setting We didn't allow filling the last byte of the config area. --- contracts/programs/ocr2/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/programs/ocr2/src/lib.rs b/contracts/programs/ocr2/src/lib.rs index e12e99588..935a71999 100644 --- a/contracts/programs/ocr2/src/lib.rs +++ b/contracts/programs/ocr2/src/lib.rs @@ -110,7 +110,7 @@ pub mod ocr2 { require!(proposal.state != Proposal::FINALIZED, InvalidInput); require!( - offchain_config.len() < proposal.offchain_config.remaining_capacity(), + offchain_config.len() <= proposal.offchain_config.remaining_capacity(), InvalidInput ); proposal.offchain_config.extend(&offchain_config);