Skip to content

Commit

Permalink
io: fix take pointer check (#4437)
Browse files Browse the repository at this point in the history
  • Loading branch information
Darksonn authored Jan 28, 2022
1 parent afd2189 commit 3c46705
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tokio/src/io/util/take.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,10 @@ impl<R: AsyncRead> AsyncRead for Take<R> {
return Poll::Ready(Ok(()));
}

let buf_ptr = buf.filled().as_ptr();

let me = self.project();
let mut b = buf.take(*me.limit_ as usize);

let buf_ptr = b.filled().as_ptr();
ready!(me.inner.poll_read(cx, &mut b))?;
assert_eq!(b.filled().as_ptr(), buf_ptr);

Expand Down

0 comments on commit 3c46705

Please sign in to comment.