Re: [PATCH] MdeModulePkg/HiiDatabase: Do not modify CONST string


Wu, Hao A
 

Pushed via:

PR - https://github.com/tianocore/edk2/pull/987

Commit - c640186ec8aae6164123ee38de6409aed69eab12

 

Best Regards,

Hao Wu

 

From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Jeff Brasen
Sent: Tuesday, October 6, 2020 5:27 AM
To: Bi, Dandan <dandan.bi@...>; devel@edk2.groups.io
Cc: Dong, Eric <eric.dong@...>
Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/HiiDatabase: Do not modify CONST string

 

Are we looking for any other reviews on this?

 

Thanks,

Jeff

 

 

From: Jeff Brasen <jbrasen@...>
Sent: Tuesday, September 22, 2020 4:13 PM
To: Bi, Dandan <dandan.bi@...>; devel@edk2.groups.io
Cc: Dong, Eric <eric.dong@...>
Subject: Re: [PATCH] MdeModulePkg/HiiDatabase: Do not modify CONST string

 

Thanks Dandan, are we waiting for any additional reviews on this change?

 

Thanks,

Jeff


From: Bi, Dandan <dandan.bi@...>
Sent: Monday, September 14, 2020 8:15 AM
To: Jeff Brasen <jbrasen@...>; devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Dong, Eric <eric.dong@...>
Subject: RE: [PATCH] MdeModulePkg/HiiDatabase: Do not modify CONST string

 

External email: Use caution opening links or attachments


Reviewed-by: Dandan Bi <dandan.bi@...>


Thanks,
Dandan
> -----Original Message-----
> From: Jeff Brasen <jbrasen@...>
> Sent: Saturday, September 12, 2020 1:09 AM
> To: devel@edk2.groups.io
> Cc: Bi, Dandan <dandan.bi@...>; Dong, Eric <eric.dong@...>;
> Jeff Brasen <jbrasen@...>
> Subject: [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@...>
> ---
>  .../Universal/HiiDatabaseDxe/ConfigRouting.c         | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
> b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
> index 2cad6d29f4..d492b769d5 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,13 @@ 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.25.1

Join devel@edk2.groups.io to automatically receive all group messages.