mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-24 09:46:59 -06:00
Security: bring Read into scope for the bounded link hash
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
committed by
bflatastic
co-authored by
Claude Opus 5.5
parent
03d2f0e83c
commit
bc56851904
@@ -94,6 +94,7 @@ pub fn hash_reader(r: impl std::io::Read) -> std::io::Result<String> {
|
||||
/// hash then covers only the first `max` + 1). A file that grew since its size was looked at isn't
|
||||
/// read to its new end.
|
||||
pub fn hash_reader_within(r: impl std::io::Read, max: u64) -> std::io::Result<(String, u64)> {
|
||||
use std::io::Read;
|
||||
let mut r = r.take(max.saturating_add(1));
|
||||
let mut buf = vec![0; 1 << 16];
|
||||
let (mut h, mut read) = (FNV_BASIS, 0u64);
|
||||
|
||||
Reference in New Issue
Block a user