]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
repart: fix partition maximum size segfault
authorEmmanuel Garette <egarette@cadoles.com>
Thu, 30 Apr 2020 07:51:29 +0000 (09:51 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 1 May 2020 15:31:45 +0000 (17:31 +0200)
Discovered, tracked down and fix proposed by Emmanuel Garette.

See: https://lists.freedesktop.org/archives/systemd-devel/2020-April/044435.html

(Lennart turned this into a PR)

Fixes: #15608
src/partition/repart.c

index 3bbc8da3f188c19911e4cc313d2c52e0537ec79b..bc9b12f167b688a7cc234f4efc678bf88d281fc0 100644 (file)
@@ -714,7 +714,7 @@ static int context_grow_partitions_on_free_area(Context *context, FreeArea *a) {
                         assert(p->new_size != UINT64_MAX);
                         m = p->new_size + span;
 
-                        xsz = partition_max_size(a->after);
+                        xsz = partition_max_size(p);
                         if (xsz != UINT64_MAX && m > xsz)
                                 m = xsz;