]> git.proxmox.com Git - mirror_edk2.git/commit
Check InternalAllocPoolByIndex status before refer buffer.
authorZeng, Star <star.zeng@intel.com>
Wed, 25 Nov 2015 02:33:06 +0000 (02:33 +0000)
committerjyao1 <jyao1@Edk2>
Wed, 25 Nov 2015 02:33:06 +0000 (02:33 +0000)
commitbf14e1077aa66ef1cb49bdaf06181de48bb2477f
tree4d331634a2697ff6f1b7f0dd5023171c5f8a736f
parent3164361121526318f278a7c1b84bdcc475d4ad95
Check InternalAllocPoolByIndex status before refer buffer.

Original code refers FreePoolHdr without check Status. It is obvious wrong and has risk.

Aslo, if InternalAllocPoolByIndex() returns an error, then *FreePoolHdr is assigned to an uninitialized value. So we init Hdr be NULL.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Zeng, Star" <star.zeng@intel.com>
Reviewed-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: "Fan, Jeff" <jeff.fan@intel.com>
Reviewed-by: "Kinney, Michael D" <michael.d.kinney@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18932 6f19259b-4bc3-4df7-8a09-765794883524
MdeModulePkg/Core/PiSmmCore/Pool.c