From 55d380144a7a2cb7afb880ce3fc9c481eb5efde2 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 19 Mar 2021 22:24:48 +0100 Subject: [PATCH] repart: add one more overflow check --- src/partition/repart.c | 3 +++ 1 file changed, 3 insertions(+) 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; -- 2.47.3