btrfs: fix SMAP violation, reading inline uncompressed data
should fix for #17061 Change-Id: I5973be6c443e8cf4460c6a3aca7b5378e90d717b Reviewed-on: https://review.haiku-os.org/c/haiku/+/5426 Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
374a3a07a1
commit
0db74b55dc
@@ -269,9 +269,10 @@ Inode::ReadAt(off_t pos, uint8* buffer, size_t* _length)
|
|||||||
}
|
}
|
||||||
|
|
||||||
*_length = min_c(extent_data->Size() - diff, *_length);
|
*_length = min_c(extent_data->Size() - diff, *_length);
|
||||||
if (compression == BTRFS_EXTENT_COMPRESS_NONE)
|
if (compression == BTRFS_EXTENT_COMPRESS_NONE) {
|
||||||
memcpy(buffer, extent_data->inline_data, *_length);
|
if (user_memcpy(buffer, extent_data->inline_data, *_length) < B_OK)
|
||||||
else if (compression == BTRFS_EXTENT_COMPRESS_ZLIB) {
|
return B_BAD_ADDRESS;
|
||||||
|
} else if (compression == BTRFS_EXTENT_COMPRESS_ZLIB) {
|
||||||
char in[2048];
|
char in[2048];
|
||||||
z_stream zStream = {
|
z_stream zStream = {
|
||||||
(Bytef*)in, // next in
|
(Bytef*)in, // next in
|
||||||
|
|||||||
Reference in New Issue
Block a user