mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-25 17:36:26 -05:00
Fix an integer overflow when computing the size of a deleted entry
This bug prevented SnapRAID to read a valid content file, in case a deleted entry bigger than 4 GB was present. This could be reproduced deleting a file bigger than 4 GB and then sync.
This commit is contained in:
parent
9bd0f18439
commit
496611f476
2 changed files with 10 additions and 1 deletions
|
|
@ -2012,7 +2012,7 @@ static void state_read_content(struct snapraid_state* state, const char* path, S
|
|||
/* if it's a run of deleted blocks */
|
||||
|
||||
/* allocate a fake deleted file */
|
||||
deleted = file_alloc(state->block_size, "<deleted>", v_count * state->block_size, 0, 0, 0, 0);
|
||||
deleted = file_alloc(state->block_size, "<deleted>", v_count * (data_off_t)state->block_size, 0, 0, 0, 0);
|
||||
|
||||
/* mark the file as deleted */
|
||||
file_flag_set(deleted, FILE_IS_DELETED);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue