]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Universal/EmuVariable/RuntimeDxe/EmuVariable.c
Merge R8 tracker #8375.
[mirror_edk2.git] / EdkModulePkg / Universal / EmuVariable / RuntimeDxe / EmuVariable.c
index bfb499ab653277f574c00936f9dcfc675e7db3bb..b44da1c47486c09a5abc0f738b5bfb69b1dfb56d 100644 (file)
@@ -336,8 +336,12 @@ Returns:
   //\r
   VarDataSize = Variable.CurrPtr->DataSize;\r
   if (*DataSize >= VarDataSize) {\r
+    if (Data == NULL) {\r
+      return EFI_INVALID_PARAMETER;\r
+    }\r
+\r
     CopyMem (Data, GetVariableDataPtr (Variable.CurrPtr), VarDataSize);\r
-    if (Attributes) {\r
+    if (Attributes != NULL) {\r
       *Attributes = Variable.CurrPtr->Attributes;\r
     }\r
 \r
@@ -382,7 +386,7 @@ Returns:
   UINTN                   VarNameSize;\r
   EFI_STATUS              Status;\r
 \r
-  if (VariableNameSize == NULL || VendorGuid == NULL) {\r
+  if (VariableNameSize == NULL || VariableName == NULL || VendorGuid == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r