From 5c5b7e6e0395f00201825bc98661cc10eda7491c Mon Sep 17 00:00:00 2001 From: Pat Hickey Date: Wed, 11 Oct 2023 17:22:05 -0700 Subject: [PATCH] note tcp bug --- crates/wasi/src/preview2/tcp.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/wasi/src/preview2/tcp.rs b/crates/wasi/src/preview2/tcp.rs index dd782c4c66..61bd746656 100644 --- a/crates/wasi/src/preview2/tcp.rs +++ b/crates/wasi/src/preview2/tcp.rs @@ -103,7 +103,7 @@ impl HostInputStream for TcpReadStream { if size == 0 { return Ok(bytes::Bytes::new()); } - + // FIXME: this is an unbounded allocation based on user input. need to bound it. let mut buf = bytes::BytesMut::with_capacity(size); let n = match self.stream.try_read_buf(&mut buf) { // A 0-byte read indicates that the stream has closed.