diff options
| author | Jack O'Connor <[email protected]> | 2022-03-27 16:50:02 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-03-27 16:50:02 -0400 |
| commit | 34d70d10b56dcd1b12db2ac58c18575d830f71b8 (patch) | |
| tree | af9ff610f84efaf291847371e440385dbb291e7f | |
| parent | 9cd41c0cfdc2fa2fcb8261ff3e1446d98495c991 (diff) | |
| parent | cd0775f8e62bb1d884bd563ce0fc0a90467e060d (diff) | |
Merge pull request #237 from strangelittlemonkey/RUSTSEC-2020-0077
Rustsec 2020 0077
| -rw-r--r-- | b3sum/Cargo.lock | 21 | ||||
| -rw-r--r-- | b3sum/Cargo.toml | 2 | ||||
| -rw-r--r-- | b3sum/src/main.rs | 8 |
3 files changed, 15 insertions, 16 deletions
diff --git a/b3sum/Cargo.lock b/b3sum/Cargo.lock index 98b1b93..e0553a6 100644 --- a/b3sum/Cargo.lock +++ b/b3sum/Cargo.lock @@ -46,7 +46,7 @@ dependencies = [ "clap", "duct", "hex", - "memmap", + "memmap2", "rayon", "tempfile", "wild", @@ -73,9 +73,9 @@ dependencies = [ [[package]] name = "block-buffer" -version = "0.10.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1d36a02058e76b040de25a4464ba1c80935655595b661505c8b39b664828b95" +checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" dependencies = [ "generic-array", ] @@ -115,9 +115,9 @@ checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" [[package]] name = "crossbeam-channel" -version = "0.5.2" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e54ea8bc3fb1ee042f5aace6e3c6e025d3874866da222930f70ce62aceba0bfa" +checksum = "5aaa7bd5fb665c6864b5f963dd9097905c54125909c7aa94c9e18507cdbe6c53" dependencies = [ "cfg-if", "crossbeam-utils", @@ -149,9 +149,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.6" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcae03edb34f947e64acdb1c33ec169824e20657e9ecb61cef6c8c74dcb8120" +checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" dependencies = [ "cfg-if", "lazy_static", @@ -280,13 +280,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" [[package]] -name = "memmap" -version = "0.7.0" +name = "memmap2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b" +checksum = "057a3db23999c867821a7a59feb06a578fcb03685e983dff90daf9e7d24ac08f" dependencies = [ "libc", - "winapi", ] [[package]] diff --git a/b3sum/Cargo.toml b/b3sum/Cargo.toml index 2f68269..3c567b1 100644 --- a/b3sum/Cargo.toml +++ b/b3sum/Cargo.toml @@ -18,7 +18,7 @@ anyhow = "1.0.25" blake3 = { version = "1", path = "..", features = ["rayon"] } clap = "3.0.5" hex = "0.4.0" -memmap = "0.7.0" +memmap2 = "0.5.3" rayon = "1.2.1" wild = "2.0.3" diff --git a/b3sum/src/main.rs b/b3sum/src/main.rs index 7b7fd60..f2f411a 100644 --- a/b3sum/src/main.rs +++ b/b3sum/src/main.rs @@ -187,7 +187,7 @@ impl Args { } enum Input { - Mmap(io::Cursor<memmap::Mmap>), + Mmap(io::Cursor<memmap2::Mmap>), File(File), Stdin, } @@ -276,7 +276,7 @@ fn copy_wide(mut reader: impl Read, hasher: &mut blake3::Hasher) -> io::Result<u // Mmap a file, if it looks like a good idea. Return None in cases where we // know mmap will fail, or if the file is short enough that mmapping isn't // worth it. However, if we do try to mmap and it fails, return the error. -fn maybe_memmap_file(file: &File) -> Result<Option<memmap::Mmap>> { +fn maybe_memmap_file(file: &File) -> Result<Option<memmap2::Mmap>> { let metadata = file.metadata()?; let file_size = metadata.len(); Ok(if !metadata.is_file() { @@ -297,9 +297,9 @@ fn maybe_memmap_file(file: &File) -> Result<Option<memmap::Mmap>> { // Explicitly set the length of the memory map, so that filesystem // changes can't race to violate the invariants we just checked. let map = unsafe { - memmap::MmapOptions::new() + memmap2::MmapOptions::new() .len(file_size as usize) - .map(&file)? + .map(file)? }; Some(map) }) |
