From: qhuang8 Date: Thu, 15 Jan 2009 03:00:00 +0000 (+0000) Subject: Apply code to avoid security warnings. X-Git-Tag: edk2-stable201903~18969 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=b364eeb012a5d64029483a6f5510654e7c94ab8a Apply code to avoid security warnings. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7279 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/MdeModulePkg/Core/Dxe/Event/Event.c b/MdeModulePkg/Core/Dxe/Event/Event.c index b2a3459324..09d5113361 100644 --- a/MdeModulePkg/Core/Dxe/Event/Event.c +++ b/MdeModulePkg/Core/Dxe/Event/Event.c @@ -399,19 +399,17 @@ CoreCreateEventEx ( } // - // Allcoate and initialize a new event structure. + // Allocate and initialize a new event structure. // - Status = CoreAllocatePool ( - ((Type & EVT_RUNTIME) != 0) ? EfiRuntimeServicesData: EfiBootServicesData, - sizeof (IEVENT), - (VOID **)&IEvent - ); - if (EFI_ERROR (Status)) { + if ((Type & EVT_RUNTIME) != 0) { + IEvent = AllocateRuntimeZeroPool (sizeof (IEVENT)); + } else { + IEvent = AllocateZeroPool (sizeof (IEVENT)); + } + if (IEvent == NULL) { return EFI_OUT_OF_RESOURCES; } - ZeroMem (IEvent, sizeof (IEVENT)); - IEvent->Signature = EVENT_SIGNATURE; IEvent->Type = Type; diff --git a/MdeModulePkg/Core/Dxe/Misc/DebugImageInfo.c b/MdeModulePkg/Core/Dxe/Misc/DebugImageInfo.c index aa93e3168f..6d5f5c0f89 100644 --- a/MdeModulePkg/Core/Dxe/Misc/DebugImageInfo.c +++ b/MdeModulePkg/Core/Dxe/Misc/DebugImageInfo.c @@ -48,6 +48,7 @@ CoreInitializeDebugImageInfoTable ( // See comments in the CoreUpdateDebugTableCrc32() function below for details. // mDebugTable = AllocateAlignedPages (EFI_SIZE_TO_PAGES (sizeof (EFI_SYSTEM_TABLE_POINTER)), FOUR_MEG_ALIGNMENT); + ASSERT (mDebugTable != NULL); mDebugTable->Signature = EFI_SYSTEM_TABLE_SIGNATURE; mDebugTable->EfiSystemTableBase = (EFI_PHYSICAL_ADDRESS) (UINTN) gDxeCoreST; mDebugTable->Crc32 = 0;