From c752e8c0bebb2753adfe8bde93ec78a56bff5b64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Wed, 21 Feb 2024 18:32:19 +0100 Subject: [PATCH] [SETUPLIB] FindSupportedSystemPartition(): Add missing NULL check Addendum to commit 59acff79e. --- base/setup/lib/utils/partlist.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/base/setup/lib/utils/partlist.c b/base/setup/lib/utils/partlist.c index 6bb16fed9d4..f89bbe3b645 100644 --- a/base/setup/lib/utils/partlist.c +++ b/base/setup/lib/utils/partlist.c @@ -3346,6 +3346,11 @@ FindSupportedSystemPartition( * should be our system partition. */ DiskEntry = GetSystemDisk(List); + if (!DiskEntry) + { + /* No system disk found, directly go check the alternative disk */ + goto UseAlternativeDisk; + } if (DiskEntry->DiskStyle == PARTITION_STYLE_GPT) {