From cbbc454b2ad9ee4359d3a145a3d622c7db22fef6 Mon Sep 17 00:00:00 2001 From: Eric Dong Date: Fri, 22 May 2015 05:37:44 +0000 Subject: [PATCH] MdeModulePkg: Validate the return value before use it. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17494 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c index 60b5daa95b..dbcf575fa9 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c @@ -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);