From e2e25e4ac19bb4380b33262745d978c1af35b545 Mon Sep 17 00:00:00 2001 From: ChristianVisintin Date: Mon, 14 Dec 2020 09:03:40 +0100 Subject: [PATCH] Fixed memory vulnerability in Windows version --- CHANGELOG.md | 2 ++ src/host/mod.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b9ec68..af31523 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ Released on 14/12/2020 - Enhancements: - File explorer: - Fixed color mismatch in local explorer +- Bugfix: + - Fixed memory vulnerability in Windows version ## 0.1.2 diff --git a/src/host/mod.rs b/src/host/mod.rs index daefa0a..2a8cbd2 100644 --- a/src/host/mod.rs +++ b/src/host/mod.rs @@ -324,7 +324,7 @@ impl Localhost { #[cfg(target_os = "windows")] #[cfg(not(tarpaulin_include))] pub fn stat(&self, path: &Path) -> Result { - let attr: Metadata = match fs::metadata(path.clone()) { + let attr: Metadata = match fs::metadata(path) { Ok(metadata) => metadata, Err(err) => return Err(HostError::new(HostErrorType::FileNotAccessible, Some(err))), };