diff options
| author | rbran <git@rubens.io> | 2025-08-12 13:21:56 +0000 |
|---|---|---|
| committer | Mason Reed <mason@vector35.com> | 2025-09-03 17:22:34 -0400 |
| commit | 1febe6f86b3d10f5a3a08bd5c26c117f4438e3dc (patch) | |
| tree | 84dcdb8a80c898e08704f0ada2d9899e8eb0d2b1 /plugins/idb_import | |
| parent | 8d4fcf6df521c56ed8332540fc0c03d64e342f96 (diff) | |
Fix idb_import invalid offset in EoF hit
Diffstat (limited to 'plugins/idb_import')
| -rw-r--r-- | plugins/idb_import/src/lib.rs | 7 |
1 files changed, 3 insertions, 4 deletions
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<usize> { 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(); |
