Patch looks good, but the term "command line" is a bit confusing.
I assume we're talking about whatever way parameters are passed from
pre-edk2 firmware to edk2, right? Is there a more precise term for
this?
/
Leif
On Mon, Nov 04, 2019 at 04:06:17PM +0000, Pete Batard wrote:
> From: Andrei Warkentin <[email protected]>
>
> It is possible for the command line to be empty
> (Cmd->TagHead.TagValueSize = 0), in which case the code should not
> attempt to read the value at CommandLine[-1].
>
> Signed-off-by: Pete Batard <[email protected]>
> ---
> Platform/RaspberryPi/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/Platform/RaspberryPi/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.c
> b/Platform/RaspberryPi/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.c
> index 5a9d4c3f1787..9b4aa068857c 100644
> --- a/Platform/RaspberryPi/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.c
> +++ b/Platform/RaspberryPi/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.c
> @@ -927,7 +927,8 @@ RpiFirmwareGetCommmandLine (
>
> CopyMem (CommandLine, Cmd->CommandLine, Cmd->TagHead.TagValueSize);
>
> - if (CommandLine[Cmd->TagHead.TagValueSize - 1] != '\0') {
> + if (Cmd->TagHead.TagValueSize == 0 ||
> + CommandLine[Cmd->TagHead.TagValueSize - 1] != '\0') {
> //
> // Add a NUL terminator if required.
> //
> --
> 2.21.0.windows.1
>
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#50243): https://edk2.groups.io/g/devel/message/50243
Mute This Topic: https://groups.io/mt/41265683/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-