[Base] Initialize file 'open_access' flag before using it.

In the 'OpenExisting' function, 'open_access' is used to create the flags for opening the file.
However, it is not set to zero, so could end up being incorrect file modes, potentially even emptying the file for appending, which would be bad.

This simply initialises it to zero first.
This commit is contained in:
noshbar 2019-10-09 15:01:11 +02:00 committed by Justin Moore
parent 85fb028faa
commit 2ce455fc73
1 changed files with 1 additions and 1 deletions

View File

@ -155,7 +155,7 @@ class PosixFileHandle : public FileHandle {
std::unique_ptr<FileHandle> FileHandle::OpenExisting(std::wstring path,
uint32_t desired_access) {
int open_access;
int open_access = 0;
if (desired_access & FileAccess::kGenericRead) {
open_access |= O_RDONLY;
}