]> git.proxmox.com Git - mirror_edk2.git/commit
ShellPkg/UefiHandleParsingLib: Fix error allocate pool
authorZhichao Gao <zhichao.gao@intel.com>
Mon, 15 Jul 2019 06:23:21 +0000 (14:23 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 5 Dec 2019 06:12:36 +0000 (06:12 +0000)
commit94d4efb54ec4ca894287276ce22d29b6261dbc0b
treea18e017a9ab77dc75f96fa5022ba2ca9f7deb530
parent2926498f01e6d8b77dff933e3e9c87eb56c709b4
ShellPkg/UefiHandleParsingLib: Fix error allocate pool

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1965

For function InsertNewGuidNameMapping, it rellocate the
mGuidList with new size
"mGuidListCount+1 * sizeof(GUID_INFO_BLOCK)". That isn't
its purpose and would cause a overflow operation in
"mGuidList[mGuidListCount - 1].xxx = xxx". Its purpose
is to increase 1 block size of mGuidList. Change it to
"(mGuidListCount + 1) * sizeof (GUID_INFO_BLOCK)".

Adjust the coding style of this function.

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Andrew Fish <afish@apple.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c