From 5cc08bd1af1799a4bcc7d2f54ca5ea65730cd7db Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Fri, 13 May 2022 16:58:43 -0400 Subject: [PATCH] fix: actually adjust the length after reading a block --- sdk/src/ipld.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/src/ipld.rs b/sdk/src/ipld.rs index c857481e0..79409a296 100644 --- a/sdk/src/ipld.rs +++ b/sdk/src/ipld.rs @@ -35,6 +35,7 @@ pub fn get(cid: &Cid) -> SyscallResult> { let mut block = Vec::with_capacity(size as usize); let remaining = sys::ipld::read(id, 0, block.as_mut_ptr(), size)?; debug_assert_eq!(remaining, 0, "expected to read the block exactly"); + block.set_len(size as usize); Ok(block) } }