Fix UBSAN report

/home/anoyes/workspace/foundationdb/fdbserver/VersionedBTree.actor.cpp:1606:10: runtime error: null pointer passed as argument 2, which is declared to never be null
This commit is contained in:
Andrew Noyes 2019-12-03 21:59:35 -08:00
parent 9ef1f4da5c
commit 560c1da805

View File

@ -1603,7 +1603,9 @@ private:
void setMetaKey(StringRef key) {
ASSERT(key.size() < (smallestPhysicalBlock - sizeof(Header)));
metaKeySize = key.size();
memcpy(this + 1, key.begin(), key.size());
if (key.size() > 0) {
memcpy(this + 1, key.begin(), key.size());
}
}
int size() const {