From 736de0b567295edc665e5e1c9979e41cc219da72 Mon Sep 17 00:00:00 2001 From: Bowen <71761807+scale-chain-sub@users.noreply.github.com> Date: Thu, 2 Jan 2025 16:50:18 -0800 Subject: [PATCH] add length check in eigenda_data.rs --- crates/eigenda/src/eigenda_data.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/eigenda/src/eigenda_data.rs b/crates/eigenda/src/eigenda_data.rs index 96bcad5..d525fa1 100644 --- a/crates/eigenda/src/eigenda_data.rs +++ b/crates/eigenda/src/eigenda_data.rs @@ -34,6 +34,9 @@ impl EigenDABlobData { helpers::remove_empty_byte_from_padded_bytes_unchecked(codec_data.as_ref()); let blob_content: Bytes = blob_content.into(); + if blob_content.len() < content_size as usize { + return Err(BlobDecodingError::InvalidLength); + } // might insert a FFT here, // take data