repart: add one more overflow check

This commit is contained in:
Lennart Poettering
2021-04-19 23:16:02 +02:00
parent d17db7b2bf
commit 55d380144a
+3
View File
@@ -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;