From d1f7e8a8f9aed001bb7c5dd653ee2678d2bffaf3 Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Tue, 12 Dec 2023 06:09:33 -0500 Subject: header only compressed buffers are valid (#604) - Bugfix: Allow attachments that contains a raw size of zero --- src/zencore/compress.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/zencore/compress.cpp') diff --git a/src/zencore/compress.cpp b/src/zencore/compress.cpp index 2362d8e78..c41bdac42 100644 --- a/src/zencore/compress.cpp +++ b/src/zencore/compress.cpp @@ -1268,7 +1268,7 @@ CompressedBuffer::FromCompressed(SharedBuffer&& InCompressedData, IoHash& OutRaw CompressedBuffer CompressedBuffer::FromCompressedNoValidate(IoBuffer&& InCompressedData) { - if (InCompressedData.GetSize() <= sizeof(detail::BufferHeader)) + if (InCompressedData.GetSize() < sizeof(detail::BufferHeader)) { return CompressedBuffer(); } @@ -1280,7 +1280,7 @@ CompressedBuffer::FromCompressedNoValidate(IoBuffer&& InCompressedData) CompressedBuffer CompressedBuffer::FromCompressedNoValidate(CompositeBuffer&& InCompressedData) { - if (InCompressedData.GetSize() <= sizeof(detail::BufferHeader)) + if (InCompressedData.GetSize() < sizeof(detail::BufferHeader)) { return CompressedBuffer(); } -- cgit v1.2.3