audk/OvmfPkg/Library/X86QemuLoadImageLib
Martin Radev ca31888271 OvmfPkg/X86QemuLoadImageLib: Handle allocation failure for CommandLine
The CommandLine and InitrdData may be set to NULL if the provided
size is too large. Because the zero page is mapped, this would not
cause an immediate crash but can lead to memory corruption instead.
This patch just adds validation and returns error if either allocation
has failed.

Signed-off-by: Martin Radev <martin.b.radev@gmail.com>
Message-Id: <YFPJsaGzVWQxoEU4@martin-ThinkPad-T440p>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
[lersek@redhat.com: drop unnecessary empty line from code; remove personal
 (hence likely unstable) repo reference from commit message]
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2021-03-19 18:13:51 +00:00
..
X86QemuLoadImageLib.c OvmfPkg/X86QemuLoadImageLib: Handle allocation failure for CommandLine 2021-03-19 18:13:51 +00:00
X86QemuLoadImageLib.inf OvmfPkg: implement QEMU loader library for X86 with legacy fallback 2020-03-05 19:45:05 +00:00