mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-25 18:40:19 -04:00
Reject content files with parity split sizes not aligned to the configured block size
This commit is contained in:
parent
fbc2107735
commit
1aa6d2b787
1 changed files with 16 additions and 0 deletions
|
|
@ -3715,6 +3715,22 @@ static void state_read_content(struct snapraid_state* state, const char* path, S
|
|||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
if (!has_block_size) {
|
||||
/* LCOV_EXCL_START */
|
||||
decoding_error(path, f);
|
||||
log_fatal(ECONTENT, "Missing 'blocksize' before parity split information in the content file!\n");
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
if (v_size % state->block_size != 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
decoding_error(path, f);
|
||||
log_fatal(ECONTENT, "Invalid parity split size %" PRIu64 " not aligned to block size %u!\n", v_size, state->block_size);
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
/* if we use this parity entry */
|
||||
if (v_level < state->level) {
|
||||
/* if this split was removed from the configuration */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue