about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAlexis Bourget <alexis.bourget@gmail.com>2020-06-01 16:19:10 +0200
committerAlexis Bourget <alexis.bourget@gmail.com>2020-06-01 16:19:10 +0200
commitd8cc2c1e4f8fa6bd49fe9c395353f9e24c7b51fc (patch)
treeef3d2b1e12e8840e3a109c97250cd2a639b98679 /src
parentb85e3fe010413b8c528d4de593d912a5ba024653 (diff)
downloadrust-d8cc2c1e4f8fa6bd49fe9c395353f9e24c7b51fc.tar.gz
rust-d8cc2c1e4f8fa6bd49fe9c395353f9e24c7b51fc.zip
Add a warning about infinite reading in read_(until|line)
Diffstat (limited to 'src')
-rw-r--r--src/libstd/io/mod.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs
index ebe6d09023f..717d2868abf 100644
--- a/src/libstd/io/mod.rs
+++ b/src/libstd/io/mod.rs
@@ -1883,6 +1883,10 @@ pub trait BufRead: Read {
     ///
     /// If successful, this function will return the total number of bytes read.
     ///
+    /// This function is blocking and should be used carefully: it is possible for
+    /// an attacker to continuously send bytes without ever sending the delimiter
+    /// or EOF.
+    ///
     /// # Errors
     ///
     /// This function will ignore all instances of [`ErrorKind::Interrupted`] and
@@ -1945,6 +1949,10 @@ pub trait BufRead: Read {
     ///
     /// If this function returns `Ok(0)`, the stream has reached EOF.
     ///
+    /// This function is blocking and should be used carefully: it is possible for
+    /// an attacker to continuously send bytes without ever sending a newline
+    /// or EOF.
+    ///
     /// # Errors
     ///
     /// This function has the same error semantics as [`read_until`] and will