diff options
author | Dandan Bi <dandan.bi@intel.com> | 2017-04-01 10:31:14 +0800 |
---|---|---|
committer | Hao Wu <hao.a.wu@intel.com> | 2017-04-05 11:26:55 +0800 |
commit | fe4a28ccbfd33cae9e1f56b174d46b4eb2329efd (patch) | |
tree | 37de8be5957859abb375b509c85ce9e5c09eb895 /MdeModulePkg/Library/UefiHiiLib/HiiLib.c | |
parent | 490433ab847cf318f31f73bbbc1a503ae47370a4 (diff) | |
download | edk2-fe4a28ccbfd33cae9e1f56b174d46b4eb2329efd.zip edk2-fe4a28ccbfd33cae9e1f56b174d46b4eb2329efd.tar.gz edk2-fe4a28ccbfd33cae9e1f56b174d46b4eb2329efd.tar.bz2 |
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
V2: The pointer StringPtr points to a string returned
by ExtractConfig/ExportConfig, if it is NULL, function
InternalHiiIfrValueAction will return FALSE. So in
current usage model, the StringPtr can not be NULL before
using it, so we can add ASSERT here.
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>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Diffstat (limited to 'MdeModulePkg/Library/UefiHiiLib/HiiLib.c')
-rw-r--r-- | MdeModulePkg/Library/UefiHiiLib/HiiLib.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c index a2abf26..cd0cd35 100644 --- a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c +++ b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c @@ -2201,8 +2201,9 @@ InternalHiiIfrValueAction ( }
StringPtr = ConfigAltResp;
-
- while (StringPtr != L'\0') {
+ ASSERT (StringPtr != NULL);
+
+ while (*StringPtr != L'\0') {
//
// 1. Find <ConfigHdr> GUID=...&NAME=...&PATH=...
//
|