Reject parity sizes exceeding data_off_t range and remove redundant block size casts

This commit is contained in:
Andrea Mazzoleni 2026-09-24 20:40:27 +02:00
parent 149b408c38
commit bcc06e10c6
6 changed files with 14 additions and 9 deletions

View file

@ -375,7 +375,7 @@ ssize_t handle_read(struct snapraid_handle* handle, block_off_t file_pos, unsign
unsigned count;
int ret;
offset = file_pos * (data_off_t)block_size;
offset = file_pos * block_size;
if (!out_missing)
out_missing = log_error;
@ -456,7 +456,7 @@ int handle_write(struct snapraid_handle* handle, block_off_t file_pos, unsigned
/* LCOV_EXCL_STOP */
}
offset = file_pos * (data_off_t)block_size;
offset = file_pos * block_size;
write_size = file_block_size(handle->file, file_pos, block_size);