diff --git a/Fw/Buffer/Buffer.cpp b/Fw/Buffer/Buffer.cpp index 010c2dc963..d244279c97 100644 --- a/Fw/Buffer/Buffer.cpp +++ b/Fw/Buffer/Buffer.cpp @@ -28,11 +28,15 @@ Buffer::Buffer(): Serializable(), {} Buffer::Buffer(const Buffer& src) : Serializable(), - m_serialize_repr(src.m_bufferData, src.m_size), + m_serialize_repr(), m_bufferData(src.m_bufferData), m_size(src.m_size), m_context(src.m_context) -{} +{ + if(src.m_bufferData != nullptr){ + this->m_serialize_repr.setExtBuffer(src.m_bufferData, src.m_size); + } +} Buffer::Buffer(U8* data, U32 size, U32 context) : Serializable(), m_serialize_repr(), diff --git a/Fw/Types/Serializable.cpp b/Fw/Types/Serializable.cpp index ec67ea618d..940db4b508 100644 --- a/Fw/Types/Serializable.cpp +++ b/Fw/Types/Serializable.cpp @@ -707,7 +707,7 @@ namespace Fw { } void ExternalSerializeBuffer::setExtBuffer(U8* buffPtr, NATIVE_UINT_TYPE size) { - FW_ASSERT(buffPtr); + FW_ASSERT(buffPtr != nullptr); this->m_buff = buffPtr; this->m_buffSize = size; }