RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
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
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104765): https://edk2.groups.io/g/devel/message/104765
Mute This Topic: https://groups.io/mt/98844375/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
[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
-=-=-=-=-=-=-=-=-=-=-=-
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/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
© 2016 - 2026 Red Hat, Inc.