Skip to content

Commit 1febe6f

Browse files
rbranemesare
authored andcommitted
Fix idb_import invalid offset in EoF hit
1 parent 8d4fcf6 commit 1febe6f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

plugins/idb_import/src/lib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,9 @@ struct BinaryViewReader<'a> {
8686
impl std::io::Read for BinaryViewReader<'_> {
8787
fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> {
8888
if !self.bv.offset_valid(self.offset) {
89-
return Err(std::io::Error::new(
90-
std::io::ErrorKind::UnexpectedEof,
91-
"Unable to read at the current offset in BinaryViewReader",
92-
));
89+
// TODO check if this is truly a EoF hit, `self.bv.len()` is not
90+
// reliable, it's returning a size bigger then the original file.
91+
return Ok(0);
9392
}
9493
let len = BinaryView::read(self.bv, buf, self.offset);
9594
self.offset += u64::try_from(len).unwrap();

0 commit comments

Comments
 (0)