public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Dandan Bi" <dandan.bi@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	"jbrasen@nvidia.com" <jbrasen@nvidia.com>
Cc: "Dong, Eric" <eric.dong@intel.com>
Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/HiiDatabase: Do not modify CONST string
Date: Tue, 24 Mar 2020 14:26:34 +0000	[thread overview]
Message-ID: <3C0D5C461C9E904E8F62152F6274C0BB40D85ED6@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <c75a943ddeb0aec9eee7172266e8d4f1062e0f36.1584634681.git.jbrasen@nvidia.com>

Thanks for the update.
Reviewed-by: Dandan Bi <dandan.bi@intel.com>


Thanks,
Dandan

> -----Original Message-----
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> Jeff Brasen
> Sent: Friday, March 20, 2020 1:21 AM
> To: devel@edk2.groups.io
> Cc: Bi, Dandan <dandan.bi@intel.com>; Dong, Eric <eric.dong@intel.com>;
> Jeff Brasen <jbrasen@nvidia.com>
> Subject: [edk2-devel] [PATCH] MdeModulePkg/HiiDatabase: Do not modify
> CONST string
> 
> Update function behavior to not modify the incoming string that is marked as
> CONST in the prototype.
> 
> Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
> ---
>  .../Universal/HiiDatabaseDxe/ConfigRouting.c        | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
> b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
> index 2cad6d29f4..e08a62c387 100644
> --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
> +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
> @@ -5497,7 +5497,6 @@ HiiBlockToConfig (
>    UINTN                               Index;
>    UINT8                               *TemBuffer;
>    CHAR16                              *TemString;
> -  CHAR16                              TemChar;
> 
>    TmpBuffer = NULL;
> 
> @@ -5564,10 +5563,14 @@ HiiBlockToConfig (
>    //
>    // Copy <ConfigHdr> and an additional '&' to <ConfigResp>
>    //
> -  TemChar = *StringPtr;
> -  *StringPtr = '\0';
> -  AppendToMultiString(Config, ConfigRequest);
> -  *StringPtr = TemChar;
> +
> +  TemString = AllocateCopyPool (sizeof (CHAR16) * (StringPtr -
> + ConfigRequest + 1), ConfigRequest);  if (TemString == NULL) {
> +    return EFI_OUT_OF_RESOURCES;
> +  }
> +  TemString[StringPtr - ConfigRequest] = '\0';
> + AppendToMultiString(Config, TemString);  FreePool (TemString);
> 
>    //
>    // Parse each <RequestElement> if exists
> --
> 2.17.1
> 
> 
> 


  reply	other threads:[~2020-03-24 14:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-19 17:21 [PATCH] MdeModulePkg/HiiDatabase: Do not modify CONST string Jeff Brasen
2020-03-24 14:26 ` Dandan Bi [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-09-11 17:08 Jeff Brasen
2020-09-14 14:15 ` Dandan Bi
2020-09-22 22:12   ` Jeff Brasen
2020-10-05 21:27     ` Jeff Brasen
2020-10-06 10:49       ` [edk2-devel] " Laszlo Ersek
2020-10-07  4:21       ` Wu, Hao A

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3C0D5C461C9E904E8F62152F6274C0BB40D85ED6@SHSMSX104.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox