pub fn check_range(
path: &str,
buf_len: usize,
range: Range<usize>,
what: &str,
) -> Result<()>Expand description
Bounds check for a field read out of a buffer whose length came from the
file. Format code calls this before slicing so that a bad count is a
Error::Corrupt a caller can catch, not a panic it cannot.