From 1c88c99cb1c4ac956d344734b229918988cfcab6 Mon Sep 17 00:00:00 2001 From: Fred Morcos Date: Tue, 24 Sep 2024 14:04:16 +0200 Subject: [PATCH] Fix new impl of serializeToBuffer --- modules/lmdbbackend/lmdbbackend.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/lmdbbackend/lmdbbackend.cc b/modules/lmdbbackend/lmdbbackend.cc index 3482256f63..38533b1590 100644 --- a/modules/lmdbbackend/lmdbbackend.cc +++ b/modules/lmdbbackend/lmdbbackend.cc @@ -918,12 +918,14 @@ std::string serializeToBuffer(const LMDBBackend::LMDBResourceRecord& value) buffer.reserve(sizeof(len) + len + sizeof(value.ttl) + sizeof(value.auth) + sizeof(value.disabled) + sizeof(value.ordername)); // Store the size of the resource record. + buffer.resize(sizeof(len)); std::memcpy(&buffer.at(0), &len, sizeof(len)); // Store the contents of the resource record. buffer += value.content; // The few other things. + buffer.resize(buffer.size() + sizeof(value.ttl)); std::memcpy(&buffer.at(sizeof(len) + len), &value.ttl, sizeof(value.ttl)); buffer.append(1, (char)value.auth); buffer.append(1, (char)value.disabled); -- 2.47.2