summaryrefslogtreecommitdiff
path: root/MdePkg/Library/PeiPcdLib/PeiPcdLib.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdePkg/Library/PeiPcdLib/PeiPcdLib.c')
-rw-r--r--MdePkg/Library/PeiPcdLib/PeiPcdLib.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/MdePkg/Library/PeiPcdLib/PeiPcdLib.c b/MdePkg/Library/PeiPcdLib/PeiPcdLib.c
index a73d804797..4018e44f70 100644
--- a/MdePkg/Library/PeiPcdLib/PeiPcdLib.c
+++ b/MdePkg/Library/PeiPcdLib/PeiPcdLib.c
@@ -586,10 +586,12 @@ LibPcdSetPtr (
PCD_PPI *PcdPpi;
UINTN Size;
+ if (*SizeOfBuffer > 0) {
+ ASSERT (Buffer != NULL);
+ }
+
PcdPpi = GetPcdPpiPtr ();
- ASSERT ((*SizeOfBuffer > 0) && Buffer == NULL);
-
Size = LibPcdGetSize (TokenNumber);
if (*SizeOfBuffer > Size) {
@@ -813,6 +815,10 @@ LibPcdSetExPtr (
PCD_PPI *PcdPpi;
UINTN Size;
+ if (*SizeOfBuffer > 0) {
+ ASSERT (Buffer != NULL);
+ }
+
PcdPpi = GetPcdPpiPtr ();
Size = LibPcdGetExSize (Guid, TokenNumber);