From: Christian Storm <
christi...@siemens.com>
If volumes[i].root == NULL, an error is printed, the return code
is updated, but there's no bailout/continue, hence the following
Close() call attempt dereferences a NULL pointer.
Avoid this by continue'ing the loop instead.
utils.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/utils.c b/utils.c
index 3929cb0..8088372 100644
--- a/utils.c
+++ b/utils.c
@@ -196,6 +196,7 @@ EFI_STATUS close_volumes(VOLUME_DESC *volumes, UINTN count)
if (!volumes[i].root) {
ERROR(L"Invalid handle for volume %d.\n", i);
result = EFI_INVALID_PARAMETER;
+ continue;
}
status = uefi_call_wrapper(volumes[i].root->Close, 1,
volumes[i].root);
--
2.32.0