aboutsummaryrefslogtreecommitdiff
path: root/contrib/epee/src/buffer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/epee/src/buffer.cpp')
-rw-r--r--contrib/epee/src/buffer.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/epee/src/buffer.cpp b/contrib/epee/src/buffer.cpp
index d637b905e..10ea6de56 100644
--- a/contrib/epee/src/buffer.cpp
+++ b/contrib/epee/src/buffer.cpp
@@ -64,7 +64,8 @@ void buffer::append(const void *data, size_t sz)
size_t reserve = (((size() + sz) * 3 / 2) + 4095) & ~4095;
new_storage.reserve(reserve);
new_storage.resize(size());
- memcpy(new_storage.data(), storage.data() + offset, storage.size() - offset);
+ if (size() > 0)
+ memcpy(new_storage.data(), storage.data() + offset, storage.size() - offset);
offset = 0;
std::swap(storage, new_storage);
}