aboutsummaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorBrooks J Rady <b.j.rady@gmail.com>2021-04-13 20:57:53 +0100
committerBrooks J Rady <b.j.rady@gmail.com>2021-04-13 20:57:53 +0100
commit265d039456dcc0931b6ef7d8c47d5fcd4908336f (patch)
treefc9495429bea21f746055e50fb868bfe10e0e443 /src/common
parentchore(crates.io): bump version to test upload (diff)
downloadsl0ppij-265d039456dcc0931b6ef7d8c47d5fcd4908336f.tar.gz
sl0ppij-265d039456dcc0931b6ef7d8c47d5fcd4908336f.tar.xz
sl0ppij-265d039456dcc0931b6ef7d8c47d5fcd4908336f.zip
fix(perf): fixed a crash when `cat`ing large files and bounded memory usage
Diffstat (limited to 'src/common')
-rw-r--r--src/common/pty_bus.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/pty_bus.rs b/src/common/pty_bus.rs
index 28ae62f2..2c132228 100644
--- a/src/common/pty_bus.rs
+++ b/src/common/pty_bus.rs
@@ -43,7 +43,7 @@ impl Stream for ReadFromPid {
// indicates end of file
Poll::Ready(None)
} else {
- let res = Some(read_buffer[..=*res].to_vec());
+ let res = Some(read_buffer[..*res].to_vec());
Poll::Ready(res)
}
}