repart: add one more overflow check

This commit is contained in:
Lennart Poettering
2021-03-19 22:24:48 +01:00
parent d17db7b2bf
commit 55d380144a

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;