From 341945982ea567c702d768609ddac250d1f2f7c2 Mon Sep 17 00:00:00 2001
From: Dominik Loidolt <dominik.loidolt@univie.ac.at>
Date: Wed, 6 Nov 2024 11:00:25 +0100
Subject: [PATCH] Fix: collection size validation in decompression header

---
 lib/decompress/decmp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/decompress/decmp.c b/lib/decompress/decmp.c
index bd93d8a..92ec926 100644
--- a/lib/decompress/decmp.c
+++ b/lib/decompress/decmp.c
@@ -1678,8 +1678,7 @@ static int cmp_ent_read_header(const struct cmp_entity *ent, struct cmp_cfg *cfg
 			debug_print("Error: The compressed data size in the compression header is smaller than a collection header.");
 			return -1;
 		}
-		if (org_size < COLLECTION_HDR_SIZE ||
-		    (org_size < (COLLECTION_HDR_SIZE + CMP_COLLECTION_FILD_SIZE) && cfg->cmp_mode != CMP_MODE_RAW)) {
+		if (org_size < COLLECTION_HDR_SIZE) {
 			debug_print("Error: The original decompressed data size in the compression header is smaller than the minimum size.");
 			return -1;
 		}
-- 
GitLab