diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-12-15 06:56:57 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-12-15 06:56:57 +0000 |
commit | cb40609c754e8ddd351b8f01a60f8097ed0b82dc (patch) | |
tree | 67dc99f4e5b299ead8e6cd70b371feb73bbc8b59 /MdeModulePkg | |
parent | 2fc46f86f91daf139ffb1bf20500d8254f037d2b (diff) | |
download | edk2-cb40609c754e8ddd351b8f01a60f8097ed0b82dc.zip edk2-cb40609c754e8ddd351b8f01a60f8097ed0b82dc.tar.gz edk2-cb40609c754e8ddd351b8f01a60f8097ed0b82dc.tar.bz2 |
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
Diffstat (limited to 'MdeModulePkg')
-rw-r--r-- | MdeModulePkg/Universal/PCD/Dxe/Service.c | 1 | ||||
-rw-r--r-- | MdeModulePkg/Universal/PCD/Pei/Service.c | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/MdeModulePkg/Universal/PCD/Dxe/Service.c b/MdeModulePkg/Universal/PCD/Dxe/Service.c index bf8e74d..8bfd199 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 4e7366e..4769600 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 {
|