[edk2-devel] [edk2-redfish-client][PATCH] RedfishClientPkg/ConverterLib: Fix empty string value issue

Nickle Wang via groups.io nicklew=nvidia.com at groups.io
Fri May 12 06:25:29 UTC 2023


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 at nvidia.com>
Cc: Abner Chang <abner.chang at amd.com>
Cc: Igor Kulchytskyy <igork at 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/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list