From 25ce9a75b67f1ec931a37e8a5f7c441202ddb0ed Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 16 Sep 2022 11:55:21 +0000 Subject: [PATCH] patches range check in get_signed_message_range (backport #27822) (#27831) * patches range check in shred::layout::get_signed_message_range (#27822) (cherry picked from commit b183e00dcfcc7e799f0ff1622e20c0becd8d3ab0) # Conflicts: # ledger/src/shred.rs * removes mergify merge conflicts Co-authored-by: behzad nouri --- ledger/src/shred.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ledger/src/shred.rs b/ledger/src/shred.rs index 997b7bd3b6861b..6a5ade8b410bc4 100644 --- a/ledger/src/shred.rs +++ b/ledger/src/shred.rs @@ -623,7 +623,7 @@ pub mod layout { merkle::ShredData::get_signed_message_range(proof_size)? } }; - (shred.len() <= range.end).then(|| range) + (range.end <= shred.len()).then(|| range) } pub(crate) fn get_reference_tick(shred: &[u8]) -> Result {