mirror of https://github.com/acidanthera/audk.git
Add some robustness check in DriverSample driver.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10209 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
51866b5465
commit
1bd57b6e76
|
@ -425,6 +425,7 @@ ExtractConfig (
|
|||
ConfigRequestHdr = HiiConstructConfigHdr (&mFormSetGuid, VariableName, PrivateData->DriverHandle[0]);
|
||||
Size = (StrLen (ConfigRequestHdr) + 32 + 1) * sizeof (CHAR16);
|
||||
ConfigRequest = AllocateZeroPool (Size);
|
||||
ASSERT (ConfigRequest != NULL);
|
||||
AllocatedRequest = TRUE;
|
||||
UnicodeSPrint (ConfigRequest, Size, L"%s&OFFSET=0&WIDTH=%016LX", ConfigRequestHdr, (UINT64)BufferSize);
|
||||
FreePool (ConfigRequestHdr);
|
||||
|
@ -454,6 +455,7 @@ ExtractConfig (
|
|||
if (StrStr (StrPointer, L"&") == NULL) {
|
||||
Size = (StrLen (Request) + 32 + 1) * sizeof (CHAR16);
|
||||
ConfigRequest = AllocateZeroPool (Size);
|
||||
ASSERT (ConfigRequest != NULL);
|
||||
AllocatedRequest = TRUE;
|
||||
UnicodeSPrint (ConfigRequest, Size, L"%s&OFFSET=0&WIDTH=%016LX", Request, (UINT64)BufferSize);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue