diff --git a/flow/Arena.h b/flow/Arena.h index 5a3c66aec9..bfef0b4a6b 100644 --- a/flow/Arena.h +++ b/flow/Arena.h @@ -625,7 +625,9 @@ public: // Copies string contents to dst and returns a pointer to the next byte after uint8_t* copyTo(uint8_t* dst) const { - memcpy(dst, data, length); + if (length > 0) { + memcpy(dst, data, length); + } return dst + length; }