Revision: 14688
http://sourceforge.net/p/edk2/code/14688
Author: jcarsey
Date: 2013-09-19 17:23:10 +0000 (Thu, 19 Sep 2013)
Log Message:
-----------
ShellPkg: Handle pool allocation failure
If AllocateZeroPool() returns NULL,
GetVariable() will return EFI_BUFFER_TOO_SMALL,
FreePool() will receive NULL.
So check for NULL before FreePool().
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Sergei Antonov <[email protected]>
Reviewed-by: Jaben Carsey <[email protected]>
Modified Paths:
--------------
trunk/edk2/ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c
Modified: trunk/edk2/ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c
===================================================================
--- trunk/edk2/ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c
2013-09-18 05:31:18 UTC (rev 14687)
+++ trunk/edk2/ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c
2013-09-19 17:23:10 UTC (rev 14688)
@@ -176,7 +176,9 @@
if (Status == EFI_BUFFER_TOO_SMALL) {
Buffer = AllocateZeroPool(Size);
Status = gRT->GetVariable((CHAR16*)VariableName, &Guid,
&Attributes2, &Size, Buffer);
- FreePool(Buffer);
+ if (Buffer != NULL) {
+ FreePool(Buffer);
+ }
Attributes = Attributes2;
}
//
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits