diff options
author | qwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-03-22 10:36:04 +0000 |
---|---|---|
committer | qwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-03-22 10:36:04 +0000 |
commit | e2180ee88cdf1bfdd33e784f9719e573fa6c1f91 (patch) | |
tree | 5929de2896ad661f27386673675bab176f77a5ac /EdkModulePkg | |
parent | c91c4f470e58765856fbcec7e88d68d498ed334e (diff) | |
download | edk2-platforms-e2180ee88cdf1bfdd33e784f9719e573fa6c1f91.tar.xz |
Add return EFI_INVALID_PARAMETER if pointer type parameter for UEFI and Tiano Decompress protocol function is NULL. The check is necessary. The protocols is built based on library instance of the Decompress Library. The Library class in MDE library spec 0.60e only define to do ASSERT for NULL pointer input.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2501 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkModulePkg')
-rw-r--r-- | EdkModulePkg/Core/Dxe/DxeMain/DxeMain.c | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/EdkModulePkg/Core/Dxe/DxeMain/DxeMain.c b/EdkModulePkg/Core/Dxe/DxeMain/DxeMain.c index fce61bd45e..427e6b8ca5 100644 --- a/EdkModulePkg/Core/Dxe/DxeMain/DxeMain.c +++ b/EdkModulePkg/Core/Dxe/DxeMain/DxeMain.c @@ -848,6 +848,11 @@ DxeMainUefiDecompressGetInfo ( OUT UINT32 *ScratchSize
)
{
+ if (Source == NULL
+ || DestinationSize == NULL
+ || ScratchSize == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
return UefiDecompressGetInfo (Source, SourceSize, DestinationSize, ScratchSize);
}
@@ -866,7 +871,13 @@ DxeMainUefiDecompress ( EFI_STATUS Status;
UINT32 TestDestinationSize;
UINT32 TestScratchSize;
-
+
+ if (Source == NULL
+ || Destination== NULL
+ || Scratch == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
Status = UefiDecompressGetInfo (Source, SourceSize, &TestDestinationSize, &TestScratchSize);
if (EFI_ERROR (Status)) {
return Status;
@@ -888,6 +899,12 @@ DxeMainTianoDecompressGetInfo ( OUT UINT32 *ScratchSize
)
{
+ if (Source == NULL
+ || DestinationSize == NULL
+ || ScratchSize == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
return TianoDecompressGetInfo (Source, SourceSize, DestinationSize, ScratchSize);
}
@@ -906,7 +923,13 @@ DxeMainTianoDecompress ( EFI_STATUS Status;
UINT32 TestDestinationSize;
UINT32 TestScratchSize;
-
+
+ if (Source == NULL
+ || Destination== NULL
+ || Scratch == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
Status = TianoDecompressGetInfo (Source, SourceSize, &TestDestinationSize, &TestScratchSize);
if (EFI_ERROR (Status)) {
return Status;
@@ -928,6 +951,12 @@ DxeMainCustomDecompressGetInfo ( OUT UINT32 *ScratchSize
)
{
+ if (Source == NULL
+ || DestinationSize == NULL
+ || ScratchSize == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
return CustomDecompressGetInfo (Source, SourceSize, DestinationSize, ScratchSize);
}
@@ -947,6 +976,12 @@ DxeMainCustomDecompress ( UINT32 TestDestinationSize;
UINT32 TestScratchSize;
+ if (Source == NULL
+ || Destination== NULL
+ || Scratch == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
Status = CustomDecompressGetInfo (Source, SourceSize, &TestDestinationSize, &TestScratchSize);
if (EFI_ERROR (Status)) {
return Status;
|