initialize local variable for UBSAN in PosixEnv function

Summary:
this is a repeat commit of a8a28da215, which got reverted together with 6afe22db2e, but forgotten about when that commit was un-reverted in 46152d53bf.
Closes https://github.com/facebook/rocksdb/pull/3796

Differential Revision: D7826077

Pulled By: ajkr

fbshipit-source-id: edb22375da56e2feda50c5b35f942f4d2d52b19c
main
Andrew Kryczka 7 years ago committed by Facebook Github Bot
parent 46152d53bf
commit 19fde54841
  1. 2
      env/env_posix.cc

2
env/env_posix.cc vendored

@ -479,7 +479,7 @@ class PosixEnv : public Env {
if (status.ok()) {
status = GetFileSize(fname, &size);
}
void* base;
void* base = nullptr;
if (status.ok()) {
base = mmap(nullptr, static_cast<size_t>(size), PROT_READ | PROT_WRITE,
MAP_SHARED, fd, 0);

Loading…
Cancel
Save