diff options
author | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-09-29 01:10:20 +0000 |
---|---|---|
committer | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-09-29 01:10:20 +0000 |
commit | 57ad9d43b16aada77eaf6f6e1aaa0dd94f032bf2 (patch) | |
tree | 9d0f53fd58c0818e0293e4d6f3da279725cd9934 /EdkCompatibilityPkg/Foundation | |
parent | 705b0c031fd2d0ce7c72832c0902efdc34a97749 (diff) | |
download | edk2-57ad9d43b16aada77eaf6f6e1aaa0dd94f032bf2.tar.gz edk2-57ad9d43b16aada77eaf6f6e1aaa0dd94f032bf2.tar.bz2 edk2-57ad9d43b16aada77eaf6f6e1aaa0dd94f032bf2.zip |
Add more check to avoid access violation.
Signed-off-by: ydong10
Reviewed-by: lgao4
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12470 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkCompatibilityPkg/Foundation')
-rw-r--r-- | EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/IfrCommon.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/IfrCommon.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/IfrCommon.c index 400b367136..c0ce1b23f8 100644 --- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/IfrCommon.c +++ b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/IfrCommon.c @@ -582,7 +582,7 @@ Returns: //
// Return an error if buffer is too small
//
- if (SizeOfNvStore > *ImageLength) {
+ if (SizeOfNvStore > *ImageLength || DefaultImage == NULL) {
gBS->FreePool (OldData);
*ImageLength = (UINT16) SizeOfNvStore;
return EFI_BUFFER_TOO_SMALL;
|