summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/partition/repart.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/partition/repart.c b/src/partition/repart.c
index 1ee5eaa25e..ac6e4e7f86 100644
--- a/src/partition/repart.c
+++ b/src/partition/repart.c
@@ -2227,6 +2227,9 @@ static int context_discard_range(
range[0] = round_up_size(offset, 512);
+ if (offset > UINT64_MAX - size)
+ return -ERANGE;
+
end = offset + size;
if (end <= range[0])
return 0;