[edk2] [patch] MdeModulePkg/UefiHiiLib:Fix incorrect comparison expression

Dandan Bi posted 1 patch 7 years ago
Failed in applying to current master (apply log)
There is a newer version of this series
MdeModulePkg/Library/UefiHiiLib/HiiLib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[edk2] [patch] MdeModulePkg/UefiHiiLib:Fix incorrect comparison expression
Posted by Dandan Bi 7 years ago
Fix the incorrect comparison between pointer and constant zero character.

https://bugzilla.tianocore.org/show_bug.cgi?id=416

Cc: Eric Dong <eric.dong@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
 MdeModulePkg/Library/UefiHiiLib/HiiLib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c
index a2abf26..166ec18 100644
--- a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c
+++ b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c
@@ -2200,11 +2200,11 @@ InternalHiiIfrValueAction (
     return FALSE;
   }
   
   StringPtr = ConfigAltResp;
   
-  while (StringPtr != L'\0') {
+  while (*StringPtr != L'\0') {
     //
     // 1. Find <ConfigHdr> GUID=...&NAME=...&PATH=...
     //
     StringHdr = StringPtr;
 
-- 
1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [patch] MdeModulePkg/UefiHiiLib:Fix incorrect comparison expression
Posted by Dong, Eric 7 years ago
It's better to add StringPtr != NULL check before use *StringPtr.

-----Original Message-----
From: Bi, Dandan 
Sent: Saturday, April 1, 2017 10:51 AM
To: edk2-devel@lists.01.org
Cc: Dong, Eric; Gao, Liming
Subject: [patch] MdeModulePkg/UefiHiiLib:Fix incorrect comparison expression

Fix the incorrect comparison between pointer and constant zero character.

https://bugzilla.tianocore.org/show_bug.cgi?id=416

Cc: Eric Dong <eric.dong@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
 MdeModulePkg/Library/UefiHiiLib/HiiLib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c
index a2abf26..166ec18 100644
--- a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c
+++ b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c
@@ -2200,11 +2200,11 @@ InternalHiiIfrValueAction (
     return FALSE;
   }
   
   StringPtr = ConfigAltResp;
   
-  while (StringPtr != L'\0') {
+  while (*StringPtr != L'\0') {
     //
     // 1. Find <ConfigHdr> GUID=...&NAME=...&PATH=...
     //
     StringHdr = StringPtr;
 
-- 
1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel