1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-12-18 13:54:11 +03:00

Tentative, unappetizing, but quick to implement fix for a mem

corruption issue where the size of the array passed in was too small.
This commit is contained in:
Patrick LeBlanc
2019-04-22 12:35:06 -05:00
parent 39b93dac2d
commit 3cb971e98b

View File

@@ -364,6 +364,17 @@ void Synchronizer::synchronizeWithJournal(const string &sourceFile, list<string>
}
throw runtime_error(string("Synchronizer: getObject() failed: ") + strerror_r(errno, buf, 80));
}
//TODO!! This sucks. Need a way to pass in a larger array to cloud storage, and also have it not
// do any add'l alloc'ing or copying
if (size < mdEntry.length)
{
boost::shared_array<uint8_t> tmp(new uint8_t[mdEntry.length]());
memcpy(tmp.get(), data.get(), size);
memset(tmp.get(), 0, mdEntry.length - size); // prob not necessary outside of testing
data.swap(tmp);
size = mdEntry.length;
}
err = ioc->mergeJournalInMem(data, size, journalName.c_str());
if (err)
{