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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user