[AMD Official Use Only - General]

Reviewed-by: Abner Chang <abner.ch...@amd.com>

> -----Original Message-----
> From: Nickle Wang <nick...@nvidia.com>
> Sent: Friday, May 12, 2023 2:25 PM
> To: devel@edk2.groups.io
> Cc: Chang, Abner <abner.ch...@amd.com>; Igor Kulchytskyy
> <ig...@ami.com>
> Subject: [edk2-redfish-client][PATCH] RedfishClientPkg/ConverterLib: Fix
> empty string value issue
> 
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
> 
> 
> allocateDuplicateStr() will not copy input string when input
> string is empty string. It returns NULL pointer and creates
> assertion in application driver.
> 
> Signed-off-by: Nickle Wang <nick...@nvidia.com>
> Cc: Abner Chang <abner.ch...@amd.com>
> Cc: Igor Kulchytskyy <ig...@ami.com>
> ---
>  RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c
> b/RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c
> index 964904a2..02fcb2b2 100644
> --- a/RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c
> +++ b/RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c
> @@ -223,7 +223,7 @@ allocateDuplicateStr (
>  {
>    RedfishCS_status  Status;
> 
> -  if ((Str == NULL) || (strlen (Str) == 0)) {
> +  if (Str == NULL) {
>      *DstBuffer = NULL;
>      return RedfishCS_status_success;
>    }
> --
> 2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104819): https://edk2.groups.io/g/devel/message/104819
Mute This Topic: https://groups.io/mt/98844375/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to