Fixed memory vulnerability in Windows version

This commit is contained in:
ChristianVisintin 2020-12-14 09:03:40 +01:00
parent 2b8be4d1e9
commit e2e25e4ac1
2 changed files with 3 additions and 1 deletions

View file

@ -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

View file

@ -324,7 +324,7 @@ impl Localhost {
#[cfg(target_os = "windows")]
#[cfg(not(tarpaulin_include))]
pub fn stat(&self, path: &Path) -> Result<FsEntry, HostError> {
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))),
};