aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2022-11-18 16:17:29 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2022-11-18 16:21:12 +0100
commit9d189b6091a7011bfac8a9c09af750614d82a10d (patch)
treef25476bac144a9a07edc5ede08e649c4aaa94f05 /lib
parent3bf38f07f0172b4698c205f72d923e9a37e53da7 (diff)
libsqfs: Fix an overzealous bounds check in the block processor
When (during fragment deduplication) a fragment block is read back from disk and unpacked, it can happen that it is _exactly_ the given block size. The bounds check did '>=' instead of '>' and failed in that case with a "data corruption" error. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib')
-rw-r--r--lib/sqfs/block_processor/block_processor.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqfs/block_processor/block_processor.c b/lib/sqfs/block_processor/block_processor.c
index de177cd..97b8958 100644
--- a/lib/sqfs/block_processor/block_processor.c
+++ b/lib/sqfs/block_processor/block_processor.c
@@ -68,7 +68,7 @@ static int load_frag_block(sqfs_block_processor_t *proc, sqfs_u32 index)
return ret;
size = SQFS_ON_DISK_BLOCK_SIZE(info.size);
- if (size >= proc->max_block_size)
+ if (size > proc->max_block_size)
return SQFS_ERROR_CORRUPTED;
if (SQFS_IS_BLOCK_COMPRESSED(info.size)) {