diff options
author | Håvard Pettersen <havardpe@yahooinc.com> | 2022-06-21 10:53:59 +0000 |
---|---|---|
committer | Håvard Pettersen <havardpe@yahooinc.com> | 2022-06-21 10:53:59 +0000 |
commit | 3bd11b2fa182c3e5f73e8fab06424ee9c8be12dd (patch) | |
tree | b0a4711466dcd654122857e4d2fdf58276404cb9 /document | |
parent | 1f9c4d5b83b314785cd9c83bbecec21cb00b192b (diff) |
stop passing nullptr
Diffstat (limited to 'document')
-rw-r--r-- | document/src/vespa/document/util/bytebuffer.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/document/src/vespa/document/util/bytebuffer.cpp b/document/src/vespa/document/util/bytebuffer.cpp index 3d38aba6dae..8568ce44c5e 100644 --- a/document/src/vespa/document/util/bytebuffer.cpp +++ b/document/src/vespa/document/util/bytebuffer.cpp @@ -164,7 +164,9 @@ void ByteBuffer::getBytes(void *buffer, uint32_t count) { const char *v = getBufferAtPos(); incPos(count); - memcpy(buffer, v, count); + if (count > 0) { + memcpy(buffer, v, count); + } } } // document |