From: Lennart Poettering Date: Fri, 19 Mar 2021 21:24:48 +0000 (+0100) Subject: repart: add one more overflow check X-Git-Tag: v249-rc1~388^2~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=55d380144a7a2cb7afb880ce3fc9c481eb5efde2;p=thirdparty%2Fsystemd.git repart: add one more overflow check --- diff --git a/src/partition/repart.c b/src/partition/repart.c index 1ee5eaa25e8..ac6e4e7f862 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;