Skip to content

Commit

Permalink
Merge pull request #4356 from wasmerio/wrong-way-around
Browse files Browse the repository at this point in the history
Fixed a subtract-with-overflow in `StaticFile::poll_read_ready()`
  • Loading branch information
Michael Bryan authored Dec 14, 2023
2 parents 88ac1b2 + 09fb64e commit 1abcd2c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/virtual-fs/src/static_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl VirtualFile for StaticFile {
}

fn poll_read_ready(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<io::Result<usize>> {
let remaining = self.0.position() - self.size();
let remaining = self.size() - self.0.position();
Poll::Ready(Ok(remaining.try_into().unwrap()))
}

Expand Down

0 comments on commit 1abcd2c

Please sign in to comment.