diff --git a/src/Synchronizer.cpp b/src/Synchronizer.cpp index ff0903a3a..8a35122e2 100644 --- a/src/Synchronizer.cpp +++ b/src/Synchronizer.cpp @@ -364,6 +364,17 @@ void Synchronizer::synchronizeWithJournal(const string &sourceFile, list } 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 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) {