Skip to content

Commit 3433695

Browse files
authored
Remove tempfile dependency to fix vulnerability (#2428)
* Update `tempfile` dependency to avoid vulnerability * Replace `tempdir` dependency by `tempfile`
1 parent 84fb332 commit 3433695

File tree

4 files changed

+10
-82
lines changed

4 files changed

+10
-82
lines changed

Cargo.lock

Lines changed: 5 additions & 77 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindgen-tests/tests/expectations/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ edition = "2018"
1212
[dependencies]
1313
objc = "0.2"
1414
block = "0.1"
15-
libloading = "0.6.2"
15+
libloading = "0.7"

bindgen-tests/tests/quickchecking/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ path = "src/bin.rs"
1616
clap = "2.28"
1717
lazy_static = "1.0"
1818
quickcheck = "1.0"
19-
tempdir = "0.3"
19+
tempfile = "3"
2020

2121
[features]
2222
# No features by default.

bindgen-tests/tests/quickchecking/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#[macro_use]
2222
extern crate lazy_static;
2323
extern crate quickcheck;
24-
extern crate tempdir;
24+
extern crate tempfile;
2525

2626
use quickcheck::{Gen, QuickCheck, TestResult};
2727
use std::error::Error;
@@ -30,7 +30,7 @@ use std::io::Write;
3030
use std::path::PathBuf;
3131
use std::process::{Command, Output};
3232
use std::sync::Mutex;
33-
use tempdir::TempDir;
33+
use tempfile::Builder;
3434

3535
/// Contains definitions of and impls for types used to fuzz C declarations.
3636
pub mod fuzzers;
@@ -52,7 +52,7 @@ lazy_static! {
5252
fn run_predicate_script(
5353
header: fuzzers::HeaderC,
5454
) -> Result<Output, Box<dyn Error>> {
55-
let dir = TempDir::new("bindgen_prop")?;
55+
let dir = Builder::new().prefix("bindgen_prop").tempdir()?;
5656
let header_path = dir.path().join("prop_test.h");
5757

5858
let mut header_file = File::create(&header_path)?;

0 commit comments

Comments
 (0)