From 6b532242ef2a26a078dcf1f795a19ceda975445a Mon Sep 17 00:00:00 2001 From: Rodolphe Breard Date: Tue, 17 Sep 2019 17:50:51 +0200 Subject: [PATCH] Return an error if end of file is reached on stdin --- opensmtpd/src/input/stdin.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opensmtpd/src/input/stdin.rs b/opensmtpd/src/input/stdin.rs index 0828113..847f0e9 100644 --- a/opensmtpd/src/input/stdin.rs +++ b/opensmtpd/src/input/stdin.rs @@ -52,7 +52,7 @@ impl FilterInput for StdIn { }, }; if len == 0 { - continue; + return Err(Error::new("Unable to read on stdin.")); } // Put the buffer's content in self.input self.input += match self.buffer.iter().position(|&x| x == 0) {