fix(tvix/nix-compat/wire/bytes): return UnexpectedEof for unexpected EOF
Change-Id: I8cb79f93742cc3a9088701bc8c2795de893eb6a8 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11547 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
This commit is contained in:
parent
fd5fc31e65
commit
88f49c8351
1 changed files with 1 additions and 4 deletions
|
@ -61,10 +61,7 @@ where
|
||||||
|
|
||||||
// make sure we got exactly the number of bytes, and not less.
|
// make sure we got exactly the number of bytes, and not less.
|
||||||
if s as u64 != padded_len {
|
if s as u64 != padded_len {
|
||||||
return Err(std::io::Error::new(
|
return Err(std::io::ErrorKind::UnexpectedEof.into());
|
||||||
std::io::ErrorKind::InvalidData,
|
|
||||||
"got less bytes than expected",
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let (_content, padding) = buf.split_at(len as usize);
|
let (_content, padding) = buf.split_at(len as usize);
|
||||||
|
|
Loading…
Reference in a new issue