OvmfPkg: fix warning about uninitialized variable

GenericQemuLoadImageLib.c: In function 'QemuLoadKernelImage':
GenericQemuLoadImageLib.c:323:5: error: 'CommandLine' may be used
  uninitialized in this function [-Werror=maybe-uninitialized]
     UnicodeSPrintAsciiFormat (
     ^~~~~~~~~~~~~~~~~~~~~~~~~~
       KernelLoadedImage->LoadOptions,
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       KernelLoadedImage->LoadOptionsSize,
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       "%a%a",
       ~~~~~~~
       (CommandLineSize == 0) ?  "" : CommandLine,
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       (InitrdSize == 0)      ?  "" : " initrd=initrd"
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       );
       ~
cc1: all warnings being treated as errors

Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
This commit is contained in:
Mike Maslenkin 2025-01-09 23:25:08 +03:00 committed by Ard Biesheuvel
parent ceb87029c5
commit 755d4b9397
1 changed files with 1 additions and 0 deletions

View File

@ -301,6 +301,7 @@ QemuLoadKernelImage (
}
}
CommandLine = NULL;
if (CommandLineSize == 0) {
KernelLoadedImage->LoadOptionsSize = 0;
} else {