From 19fde548419e29975963d2c325710f532fba4022 Mon Sep 17 00:00:00 2001 From: Andrew Kryczka Date: Tue, 1 May 2018 13:18:01 -0700 Subject: [PATCH] initialize local variable for UBSAN in PosixEnv function Summary: this is a repeat commit of a8a28da2159648a2f72c35ea507371df8a97a2a9, which got reverted together with 6afe22db2e667799d8c903db61750d676bffe152, but forgotten about when that commit was un-reverted in 46152d53bf58748fc3ed0681d8970c342bcfc47a. Closes https://github.com/facebook/rocksdb/pull/3796 Differential Revision: D7826077 Pulled By: ajkr fbshipit-source-id: edb22375da56e2feda50c5b35f942f4d2d52b19c --- env/env_posix.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/env/env_posix.cc b/env/env_posix.cc index a9895ec78..038d7c44a 100644 --- a/env/env_posix.cc +++ b/env/env_posix.cc @@ -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), PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);