From cb40609c754e8ddd351b8f01a60f8097ed0b82dc Mon Sep 17 00:00:00 2001 From: lgao4 Date: Thu, 15 Dec 2011 06:56:57 +0000 Subject: Update PcdSetPtr() API to set the output buffer size to the max buffer size when the input buffer size is larger than the max buffer size. This behavior follows API description. Signed-off-by: lgao4 Reviewed-by: jlin16 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12875 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Universal/PCD/Dxe/Service.c | 1 + MdeModulePkg/Universal/PCD/Pei/Service.c | 1 + 2 files changed, 2 insertions(+) (limited to 'MdeModulePkg/Universal/PCD') diff --git a/MdeModulePkg/Universal/PCD/Dxe/Service.c b/MdeModulePkg/Universal/PCD/Dxe/Service.c index bf8e74dfb3..8bfd199e48 100644 --- a/MdeModulePkg/Universal/PCD/Dxe/Service.c +++ b/MdeModulePkg/Universal/PCD/Dxe/Service.c @@ -746,6 +746,7 @@ SetWorker ( // GetPtrTypeSize (TokenNumber, &MaxSize); if (*Size > MaxSize) { + *Size = MaxSize; return EFI_INVALID_PARAMETER; } } else { diff --git a/MdeModulePkg/Universal/PCD/Pei/Service.c b/MdeModulePkg/Universal/PCD/Pei/Service.c index 4e7366e759..4769600da7 100644 --- a/MdeModulePkg/Universal/PCD/Pei/Service.c +++ b/MdeModulePkg/Universal/PCD/Pei/Service.c @@ -391,6 +391,7 @@ SetWorker ( // GetPtrTypeSize (TokenNumber, &MaxSize, PeiPcdDb); if (*Size > MaxSize) { + *Size = MaxSize; return EFI_INVALID_PARAMETER; } } else { -- cgit v1.2.3