summaryrefslogtreecommitdiff
path: root/MdePkg
diff options
context:
space:
mode:
Diffstat (limited to 'MdePkg')
-rw-r--r--MdePkg/Library/BasePcdLibNull/PcdLib.c9
-rw-r--r--MdePkg/Library/DxePcdLib/DxePcdLib.c11
-rw-r--r--MdePkg/Library/PeiPcdLib/PeiPcdLib.c10
3 files changed, 22 insertions, 8 deletions
diff --git a/MdePkg/Library/BasePcdLibNull/PcdLib.c b/MdePkg/Library/BasePcdLibNull/PcdLib.c
index 832100758f..de90c2f90e 100644
--- a/MdePkg/Library/BasePcdLibNull/PcdLib.c
+++ b/MdePkg/Library/BasePcdLibNull/PcdLib.c
@@ -461,7 +461,9 @@ LibPcdSetPtr (
IN VOID *Buffer
)
{
- ASSERT (Buffer != NULL);
+ if (*SizeOfBuffer > 0) {
+ ASSERT (Buffer != NULL);
+ }
return Buffer;
}
@@ -630,7 +632,10 @@ LibPcdSetExPtr (
)
{
ASSERT (Guid != NULL);
- ASSERT (Buffer != NULL);
+
+ if (*SizeOfBuffer > 0) {
+ ASSERT (Buffer != NULL);
+ }
return Buffer;
}
diff --git a/MdePkg/Library/DxePcdLib/DxePcdLib.c b/MdePkg/Library/DxePcdLib/DxePcdLib.c
index fe7ae4247c..ec5da259a6 100644
--- a/MdePkg/Library/DxePcdLib/DxePcdLib.c
+++ b/MdePkg/Library/DxePcdLib/DxePcdLib.c
@@ -513,8 +513,10 @@ LibPcdSetPtr (
{
EFI_STATUS Status;
UINTN Size;
-
- ASSERT ((*SizeOfBuffer > 0) && Buffer == NULL);
+
+ if (*SizeOfBuffer > 0) {
+ ASSERT (Buffer != NULL);
+ }
Size = LibPcdGetSize (TokenNumber);
@@ -726,8 +728,9 @@ LibPcdSetExPtr (
EFI_STATUS Status;
UINTN Size;
- ASSERT (Guid != NULL);
- ASSERT (Buffer != NULL);
+ if (*SizeOfBuffer > 0) {
+ ASSERT (Buffer != NULL);
+ }
Size = LibPcdGetExSize (Guid, TokenNumber);
if (*SizeOfBuffer > Size) {
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);