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 (#104765): https://edk2.groups.io/g/devel/message/104765
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