summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/PCD/Dxe/Service.c
diff options
context:
space:
mode:
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2010-01-14 16:29:29 +0000
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2010-01-14 16:29:29 +0000
commit149fb6d6804314a7010d6ebf3f3494ff18997a57 (patch)
tree1955f34b08183ce20eb106bb28e54be381443eb5 /MdeModulePkg/Universal/PCD/Dxe/Service.c
parent62e797a489341b13a095b3cd7c0f7bd9eac12efe (diff)
downloadedk2-platforms-149fb6d6804314a7010d6ebf3f3494ff18997a57.tar.xz
According to PI 1.2 spec Vol 3 chapter 8 PCD, if the PCD service determined that the size of the data being set was
incompatible with a call to this function, PCD_PPI/PROTOCOL's SetXEx interfaces should be return EFI_INVALID_PARAEMTER instead of ASSERT(). git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9753 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/PCD/Dxe/Service.c')
-rw-r--r--MdeModulePkg/Universal/PCD/Dxe/Service.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/MdeModulePkg/Universal/PCD/Dxe/Service.c b/MdeModulePkg/Universal/PCD/Dxe/Service.c
index 532bb39cc4..1999ac6cc4 100644
--- a/MdeModulePkg/Universal/PCD/Dxe/Service.c
+++ b/MdeModulePkg/Universal/PCD/Dxe/Service.c
@@ -1,7 +1,7 @@
/** @file
Help functions used by PCD DXE driver.
-Copyright (c) 2006 - 2007, Intel Corporation
+Copyright (c) 2006 - 2010, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -678,6 +678,7 @@ SetValueWorker (
@retval EFI_INVALID_PARAMETER If this PCD type is VPD, VPD PCD can not be set.
@retval EFI_INVALID_PARAMETER If Size can not be set to size table.
+ @retval EFI_INVALID_PARAMETER If Size of non-Ptr type PCD does not match the size information in PCD database.
@retval EFI_NOT_FOUND If value type of PCD entry is intergrate, but not in
range of UINT8, UINT16, UINT32, UINT64
@retval EFI_NOT_FOUND Can not find the PCD type according to token number.
@@ -727,8 +728,8 @@ SetWorker (
//
ASSERT (TokenNumber + 1 < PCD_TOTAL_TOKEN_NUMBER + 1);
- if (!PtrType) {
- ASSERT (*Size == DxePcdGetSize (TokenNumber + 1));
+ if ((!PtrType) && (*Size != DxePcdGetSize (TokenNumber + 1))) {
+ return EFI_INVALID_PARAMETER;
}
//