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 and carllerche committed Jan 30, 2022
1 parent cafdcfc commit 27870cd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tokio/src/io/util/take.rs
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 27870cd

Please sign in to comment.