mirror of https://github.com/acidanthera/audk.git
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
This commit is contained in:
parent
b2f5a3718b
commit
887c077d91
|
@ -690,10 +690,14 @@ CreateIfrDataArray (
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EFI_IFR_TYPE_STRING:
|
case EFI_IFR_TYPE_STRING:
|
||||||
String = HiiGetString (ConfigAccess->ThunkContext->UefiHiiHandle, Value->string, NULL);
|
if (Value->string == 0) {
|
||||||
ASSERT (String != NULL);
|
Size = 0;
|
||||||
|
} else {
|
||||||
|
String = HiiGetString (ConfigAccess->ThunkContext->UefiHiiHandle, Value->string, NULL);
|
||||||
|
ASSERT (String != NULL);
|
||||||
|
|
||||||
Size = StrSize (String);
|
Size = StrSize (String);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -741,9 +745,11 @@ CreateIfrDataArray (
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EFI_IFR_TYPE_STRING:
|
case EFI_IFR_TYPE_STRING:
|
||||||
ASSERT (String != NULL);
|
if (Size != 0) {
|
||||||
StrCpy ((CHAR16 *) &IfrDataEntry->Data, String);
|
ASSERT (String != NULL);
|
||||||
FreePool (String);
|
StrCpy ((CHAR16 *) &IfrDataEntry->Data, String);
|
||||||
|
FreePool (String);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT (FALSE);
|
ASSERT (FALSE);
|
||||||
|
|
Loading…
Reference in New Issue