compress: limit the output to dst_max bytes with LZ4 if set

We already do that with other algorithms, so let's make
decompress_blob_lz4() consistent with the rest.
This commit is contained in:
Frantisek Sumsal
2026-04-12 16:28:15 +02:00
parent d830bb1fc1
commit 2cda5f6169
+2
View File
@@ -739,6 +739,8 @@ static int decompress_blob_lz4(
size = unaligned_read_le64(src);
if (size < 0 || (unsigned) size != unaligned_read_le64(src))
return -EFBIG;
if (dst_max > 0 && (size_t) size > dst_max)
return -ENOBUFS;
out = greedy_realloc(dst, size, 1);
if (!out)
return -ENOMEM;