Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: handle overflow when computing mmap offset during restore
Since we dropped the explicit offset field from the snapshot file, we are implicit computing it as "sum of sizes of all preceding regions". If the snapshot file is corrupted, it can describe regions whose sum exceeds u64::MAX. Fix this by adding overflow checks and returning an error in case of overflows We also error out if it exceeds i64::MAX as the offset argument to mmap(2) is a signed 64 bit integer value. Fixes: d835805 Signed-off-by: Patrick Roy <[email protected]>
- Loading branch information