diff options
author | rsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-04-16 07:02:42 +0000 |
---|---|---|
committer | rsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-04-16 07:02:42 +0000 |
commit | 887c077d91a648a5e206cc19790878ebf521745e (patch) | |
tree | 30a28e435ab3e6edb1942f2ad1e7d86938ba9253 /EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk | |
parent | b2f5a3718b075ac8967d3c9c529fefe8b0d3ec3d (diff) | |
download | edk2-platforms-887c077d91a648a5e206cc19790878ebf521745e.tar.xz |
Fix an issue that an assert occurrs if user inputs a password whose length is less than the minimum required length. The root cause is that under such case the Form Browser will pass a null string (string ID = 0) to the Config Access callback. The callback handler does not handle such case correctly.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8103 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk')
-rw-r--r-- | EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/ConfigAccess.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/ConfigAccess.c b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/ConfigAccess.c index ac6f2ac244..b8d0021303 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/ConfigAccess.c +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/ConfigAccess.c @@ -690,10 +690,14 @@ CreateIfrDataArray ( break;
case EFI_IFR_TYPE_STRING:
- String = HiiGetString (ConfigAccess->ThunkContext->UefiHiiHandle, Value->string, NULL);
- ASSERT (String != NULL);
+ if (Value->string == 0) {
+ Size = 0;
+ } else {
+ String = HiiGetString (ConfigAccess->ThunkContext->UefiHiiHandle, Value->string, NULL);
+ ASSERT (String != NULL);
- Size = StrSize (String);
+ Size = StrSize (String);
+ }
break;
default:
@@ -741,9 +745,11 @@ CreateIfrDataArray ( break;
case EFI_IFR_TYPE_STRING:
- ASSERT (String != NULL);
- StrCpy ((CHAR16 *) &IfrDataEntry->Data, String);
- FreePool (String);
+ if (Size != 0) {
+ ASSERT (String != NULL);
+ StrCpy ((CHAR16 *) &IfrDataEntry->Data, String);
+ FreePool (String);
+ }
break;
default:
ASSERT (FALSE);
|