Skip to content

Commit

Permalink
Try to fix CI build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
wqx6 committed Jan 7, 2025
1 parent 267b09d commit 7ecbf7b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/system/SystemPacketBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,9 @@ PacketBufferHandle PacketBufferHandle::New(size_t aAvailableSize, uint16_t aRese
lPacket->payload = lPacket->ReserveStart() + aReservedSize;
#if CHIP_SYSTEM_PACKETBUFFER_FROM_CHIP_HEAP
lPacket->alloc_size = lAllocSize;
#endif
#if !CHIP_SYSTEM_CONFIG_USE_LWIP
lPacket->next = nullptr;
#endif
// Set current packet and chained buffers' length and total length to 0
for (PacketBuffer * pktBuf = lPacket; pktBuf != nullptr; pktBuf = pktBuf->ChainedBuffer())
Expand Down Expand Up @@ -664,7 +667,7 @@ PacketBufferHandle PacketBufferHandle::NewWithData(const void * aData, size_t aD
#endif
PacketBuffer * currentBuffer = buffer.mBuffer;
const uint8_t * dataPtr = static_cast<const uint8_t *>(aData);
while (aDataSize > 0)
while (currentBuffer && aDataSize > 0)
{
size_t copyLen = currentBuffer->MaxDataLength() > aDataSize ? aDataSize : currentBuffer->MaxDataLength();
memcpy(currentBuffer->payload, dataPtr, copyLen);
Expand Down

0 comments on commit 7ecbf7b

Please sign in to comment.