diff options
author | Andrei Pavel <andrei@isc.org> | 2022-01-25 13:28:04 +0100 |
---|---|---|
committer | Andrei Pavel <andrei@isc.org> | 2022-01-25 13:31:26 +0100 |
commit | e1b2adad9069342f0f4dd9dc611478b56f86dbe5 (patch) | |
tree | 19c9c87c523946a36efd9064a8986ffc5bc5b4d1 /src/lib/util | |
parent | [#2225] allow PGPASSWORD to be set from outside admin-utils.sh (diff) | |
download | kea-e1b2adad9069342f0f4dd9dc611478b56f86dbe5.tar.xz kea-e1b2adad9069342f0f4dd9dc611478b56f86dbe5.zip |
[#2283] exit early when packing a zero length OpaqueDataTuple
Diffstat (limited to 'src/lib/util')
-rw-r--r-- | src/lib/util/buffer.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/util/buffer.h b/src/lib/util/buffer.h index 019d373af7..b1d5204538 100644 --- a/src/lib/util/buffer.h +++ b/src/lib/util/buffer.h @@ -548,6 +548,10 @@ public: /// \param data A pointer to the data to be copied into the buffer. /// \param len The length of the data in bytes. void writeData(const void *data, size_t len) { + if (len == 0) { + return; + } + ensureAllocated(size_ + len); static_cast<void>(std::memmove(buffer_ + size_, data, len)); size_ += len; |