aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2024-01-01 15:51:13 -0500
committerGitHub <noreply@github.com>2024-01-01 15:51:13 -0500
commit85d93a502c63dc68a56ee67c65889efe6924ca30 (patch)
treea646db0b18c8852cd0ffb488e0c57422897a3ae2
parentf565c6df0e8ae5e25f9de4de91846286e12ba0d0 (diff)
parent899ea60ccdc1365e6a947e869c92dece986532ea (diff)
downloadrbw-85d93a502c63dc68a56ee67c65889efe6924ca30.tar.gz
rbw-85d93a502c63dc68a56ee67c65889efe6924ca30.zip
Merge pull request #140 from Mic92/no-fail
handle eof correctly when reading from pinentry
-rw-r--r--src/pinentry.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/pinentry.rs b/src/pinentry.rs
index f7d36c7..e2a83ed 100644
--- a/src/pinentry.rs
+++ b/src/pinentry.rs
@@ -137,6 +137,14 @@ where
.read(&mut data[len..])
.await
.map_err(|source| Error::PinentryReadOutput { source })?;
+ if bytes == 0 {
+ return Err(Error::PinentryReadOutput {
+ source: std::io::Error::new(
+ std::io::ErrorKind::UnexpectedEof,
+ "unexpected EOF",
+ ),
+ });
+ }
len += bytes;
}
}