Commit 14f0fd05 authored by Greg Thompson's avatar Greg Thompson Committed by Commit Bot

LZMA: Unconditionally flush output files after unmapping.

BUG=933975,1069116
R=etiennep@chromium.org

Change-Id: I294eba49176369fe06f541e681b7fee84aba48bd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2146548
Commit-Queue: Greg Thompson <grt@chromium.org>
Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
Reviewed-by: default avatarEtienne Pierre-Doray <etiennep@chromium.org>
Auto-Submit: Greg Thompson <grt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#758876}
parent ab93ef72
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include "base/logging.h" #include "base/logging.h"
#include "base/optional.h" #include "base/optional.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/win/windows_version.h"
extern "C" { extern "C" {
#include "third_party/lzma_sdk/7z.h" #include "third_party/lzma_sdk/7z.h"
...@@ -370,11 +369,11 @@ UnPackStatus LzmaUtilImpl::UnPack(const base::FilePath& location, ...@@ -370,11 +369,11 @@ UnPackStatus LzmaUtilImpl::UnPack(const base::FilePath& location,
// Unmap the target file from the process's address space. // Unmap the target file from the process's address space.
mapped_file.reset(); mapped_file.reset();
last_folder_index = -1; last_folder_index = -1;
// Flush to avoid an interesting bug in Windows 7 through Windows 10 // Flush to avoid odd behavior, such as the bug in Windows 7 through
// 1809; see // Windows 10 1809 for PE files described in
// https://randomascii.wordpress.com/2018/02/25/compiler-bug-linker-bug-windows-kernel-bug/ // https://randomascii.wordpress.com/2018/02/25/compiler-bug-linker-bug-windows-kernel-bug/.
// for details. // We've also observed oddly empty files on other Windows versions, so
if (base::win::GetVersion() < base::win::Version::WIN10_RS5) // this is unconditional.
target_file.Flush(); target_file.Flush();
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment