public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-redfish-client][PATCH] RedfishClientPkg/ConverterLib: Fix empty string value issue
@ 2023-05-12  6:25 Nickle Wang
  2023-05-14 14:48 ` Chang, Abner
  0 siblings, 1 reply; 2+ messages in thread
From: Nickle Wang @ 2023-05-12  6:25 UTC (permalink / raw)
  To: devel; +Cc: Abner Chang, Igor Kulchytskyy

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 <nicklew@nvidia.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [edk2-redfish-client][PATCH] RedfishClientPkg/ConverterLib: Fix empty string value issue
  2023-05-12  6:25 [edk2-redfish-client][PATCH] RedfishClientPkg/ConverterLib: Fix empty string value issue Nickle Wang
@ 2023-05-14 14:48 ` Chang, Abner
  0 siblings, 0 replies; 2+ messages in thread
From: Chang, Abner @ 2023-05-14 14:48 UTC (permalink / raw)
  To: Nickle Wang, devel@edk2.groups.io; +Cc: Igor Kulchytskyy

[AMD Official Use Only - General]

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

> -----Original Message-----
> From: Nickle Wang <nicklew@nvidia.com>
> Sent: Friday, May 12, 2023 2:25 PM
> To: devel@edk2.groups.io
> Cc: Chang, Abner <Abner.Chang@amd.com>; Igor Kulchytskyy
> <igork@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 <nicklew@nvidia.com>
> Cc: Abner Chang <abner.chang@amd.com>
> Cc: Igor Kulchytskyy <igork@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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-14 14:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-12  6:25 [edk2-redfish-client][PATCH] RedfishClientPkg/ConverterLib: Fix empty string value issue Nickle Wang
2023-05-14 14:48 ` Chang, Abner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox