mirror of https://github.com/acidanthera/audk.git
MdeModulePkg: Validate the return value before use it.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong <eric.dong@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17494 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
b965bd99c5
commit
cbbc454b2a
|
@ -2031,6 +2031,7 @@ ExtractConfigRequest (
|
|||
}
|
||||
RequestElement = ConstructRequestElement(Name, Offset, Width);
|
||||
ConfigHdr = ConstructConfigHdr(Storage, DatabaseRecord->DriverHandle);
|
||||
ASSERT (ConfigHdr != NULL);
|
||||
|
||||
Length = (StrLen (ConfigHdr) + 1 + StrLen(RequestElement) + 1) * sizeof (CHAR16);
|
||||
*ConfigRequest = AllocatePool (Length);
|
||||
|
@ -2138,6 +2139,7 @@ ExtractConfigResp (
|
|||
RequestElement = ConstructRequestElement(Name, Offset, Width);
|
||||
|
||||
ConfigHdr = ConstructConfigHdr(Storage, DatabaseRecord->DriverHandle);
|
||||
ASSERT (ConfigHdr != NULL);
|
||||
|
||||
Length = (StrLen (ConfigHdr) + 1 + StrLen(RequestElement) + 1 + StrLen (L"VALUE=") + StrLen(ValueElement) + 1) * sizeof (CHAR16);
|
||||
*ConfigResp = AllocatePool (Length);
|
||||
|
|
Loading…
Reference in New Issue