]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.c
MdeModulePkg SmmLockBox: Return updated Length for EFI_BUFFER_TOO_SMALL
[mirror_edk2.git] / MdeModulePkg / Universal / LockBox / SmmLockBox / SmmLockBox.c
index 2dc8815f2eb5f60cefaadf6c3b74aba1bec04cc4..d4183ca4b05796b48cc18e3e7d9b33835d3bc91f 100644 (file)
@@ -9,7 +9,7 @@
   SmmLockBoxHandler(), SmmLockBoxRestore(), SmmLockBoxUpdate(), SmmLockBoxSave()\r
   will receive untrusted input and do basic validation.\r
 \r
-Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>\r
 \r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions\r
@@ -217,6 +217,9 @@ SmmLockBoxRestore (
                (VOID *)(UINTN)TempLockBoxParameterRestore.Buffer,\r
                (UINTN *)&TempLockBoxParameterRestore.Length\r
                );\r
+    if (Status == EFI_BUFFER_TOO_SMALL) {\r
+      LockBoxParameterRestore->Length = TempLockBoxParameterRestore.Length;\r
+    }\r
   }\r
   LockBoxParameterRestore->Header.ReturnStatus = (UINT64)Status;\r
   return ;\r