[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:
parent
85fb028faa
commit
2ce455fc73
|
@ -155,7 +155,7 @@ class PosixFileHandle : public FileHandle {
|
||||||
|
|
||||||
std::unique_ptr<FileHandle> FileHandle::OpenExisting(std::wstring path,
|
std::unique_ptr<FileHandle> FileHandle::OpenExisting(std::wstring path,
|
||||||
uint32_t desired_access) {
|
uint32_t desired_access) {
|
||||||
int open_access;
|
int open_access = 0;
|
||||||
if (desired_access & FileAccess::kGenericRead) {
|
if (desired_access & FileAccess::kGenericRead) {
|
||||||
open_access |= O_RDONLY;
|
open_access |= O_RDONLY;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue