summaryrefslogtreecommitdiffstats
path: root/openpgp
diff options
context:
space:
mode:
authorNora Widdecke <nora@sequoia-pgp.org>2020-09-24 15:13:26 +0200
committerNora Widdecke <nora@sequoia-pgp.org>2020-09-24 15:24:11 +0200
commitf3608f5c87c011076390a5e4aa551c8332ef3b90 (patch)
treef6acfe7579db234f18d74675667f427ccc100e4d /openpgp
parentc593ff5fd0af4fe8c26ee54f057b283e78273e83 (diff)
openpgp: Ensure entire header is read.
- https://rust-lang.github.io/rust-clippy/master/index.html#unused_io_amount - Replace `read` with `read_exact`, so that an error is returned if the buffer cannot be filled.
Diffstat (limited to 'openpgp')
-rw-r--r--openpgp/src/parse.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/openpgp/src/parse.rs b/openpgp/src/parse.rs
index b6963d2c..4e9aefb0 100644
--- a/openpgp/src/parse.rs
+++ b/openpgp/src/parse.rs
@@ -5138,7 +5138,7 @@ impl<'a> PacketParser<'a> {
let mut dec = Decryptor::new(
algo, key, &self.data_hard(bl + 2)?[..bl + 2])?;
let mut header = vec![ 0u8; bl + 2 ];
- dec.read(&mut header)?;
+ dec.read_exact(&mut header)?;
if !(header[bl - 2] == header[bl]
&& header[bl - 1] == header[bl + 1]) {