diff options
-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 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 {
|