From 1febe6f86b3d10f5a3a08bd5c26c117f4438e3dc Mon Sep 17 00:00:00 2001 From: rbran Date: Tue, 12 Aug 2025 13:21:56 +0000 Subject: Fix idb_import invalid offset in EoF hit --- plugins/idb_import/src/lib.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'plugins') diff --git a/plugins/idb_import/src/lib.rs b/plugins/idb_import/src/lib.rs index fac9deb1..b1643ea3 100644 --- a/plugins/idb_import/src/lib.rs +++ b/plugins/idb_import/src/lib.rs @@ -86,10 +86,9 @@ struct BinaryViewReader<'a> { impl std::io::Read for BinaryViewReader<'_> { fn read(&mut self, buf: &mut [u8]) -> std::io::Result { if !self.bv.offset_valid(self.offset) { - return Err(std::io::Error::new( - std::io::ErrorKind::UnexpectedEof, - "Unable to read at the current offset in BinaryViewReader", - )); + // TODO check if this is truly a EoF hit, `self.bv.len()` is not + // reliable, it's returning a size bigger then the original file. + return Ok(0); } let len = BinaryView::read(self.bv, buf, self.offset); self.offset += u64::try_from(len).unwrap(); -- cgit v1.3.1